i have to validate 250K lines of data. i'm out of memory. what do I do? something with garbage collection???
a Cambece
Printable View
i have to validate 250K lines of data. i'm out of memory. what do I do? something with garbage collection???
a Cambece
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.
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.Quote:
Originally Posted by feilusun
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).
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.