CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2005
    Posts
    1

    garbage collection

    i have to validate 250K lines of data. i'm out of memory. what do I do? something with garbage collection???

    a Cambece

  2. #2
    Join Date
    Aug 2005
    Posts
    24

    Re: garbage collection

    What you should do: Re-write your application so that it doesn't try to hold all the lines into memory at the same time, because that's probably not necessary.

    You didn't say anything about what your program does with the data, so it's impossible to give you more specific help.

  3. #3
    Join Date
    Nov 2003
    Posts
    1,405

    Re: garbage collection

    Quote Originally Posted by feilusun
    something with garbage collection???
    Both yes and not. Do you need to hold on to that large amount of data (assuming 250K lines, whatever that it is, is a large amount of data). If you don't need all data at the same time, read a little at the time, process it, and then release it for garbage collection.

    If you do need all the data at the same time you can increase the heap space available to the JVM (assuming there's memory available in the computer).

  4. #4
    Join Date
    Apr 2003
    Location
    Los Angeles area
    Posts
    776

    Re: garbage collection

    The poster is asking how to find/ween the memory allocation hog in his 250,000 lines of code.

    I have not used the profiler yet but it is integrated into the Netbeans IDE which is free.
    http://profiler.netbeans.org/

    There are other profilers, just google for java profilers. You can also set higher heap sizes for the jvm with command line switches for java.exe but this won't solve memory hog issues.
    "The Chicken and Rice MRE is not a personal lubricant."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured