• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

java.lang.OutOfMemoryError: Java heap space

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
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....
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ??
 
Ranch Hand
Posts: 893
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ganeshkumar cheekati
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...





 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!