File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes java.lang.OutOfMemoryError: Java heap space Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "java.lang.OutOfMemoryError: Java heap space" Watch "java.lang.OutOfMemoryError: Java heap space" New topic

java.lang.OutOfMemoryError: Java heap space

Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
i am getting java.lang.OutOfMemoryError: Java heap space in my code where i am exporting 20,000 records to excel sheet using POI...
Can anyone give me solution for this?
Thanks in Advance....

SCJP5 and SCWCD1.5
Think Twice Act Wise...
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

You could try to increase the heap memory size on the server

and maybe you also need to set

Another very important issue is the code it self - does it preform god enough ??

Regards, Rene Larsen
Dropbox Invite
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
A different solution could be adjusting the code where the 20.000 lines are imported in parts to Excel and not al the records are read in memory at once.

Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
i am doing the samething like creating different sheets for each 250 records while exporting to excel using poi api but it is not working.

Eventhough i used the command to increase the heapsize in tomcat also not working.

In companies we are using tomcat with out installation that why command is not working..

Any suggestion

Thanks in Advance...

I agree. Here's the link:
subject: java.lang.OutOfMemoryError: Java heap space
jQuery in Action, 3rd edition