View Single Post
  #2 (permalink)  
Old 05-20-2007, 10:52 PM
levent levent is offline
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
If you're getting OutOfMemoryError, the simplest thing to try is to give the VM more memory at startup. For Sun's VM, I believe the default was 64 MB. You can increase this by using the -X args that control the heap size. For example:

java -Xms128m -Xmx256m ... etc. ...


This says start with 128 MB of heap, and allow it to grow up to 256 MB.

One thing to consider, though, is do you need that much stuff in memory at once? A more intelligent approach might be to unpack the archive to the file system, and then read a file at a time or a line at a time or a whatever at a time is appropriate for the processing you need to do.
Reply With Quote