Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exeption while writing huge data to excel sheet

 
haripriya kaligotla
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Joined: Jul 21, 2010
Posts: 1

[Post New] posted Today 3:44:37 PM private message
Quote
Hi,
We are tryiing to write 60k rows and 100 cols to an excel sheet but getting the below exception:

"Exception in thread "main" java.lang.OutOfMemoryError: Java heap space"

Any help to get rid of this would be appreciated. Thanks.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Increase the heap space? Don't keep everything in memory?
 
haripriya kaligotla
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We tried increasing the heap and it did work, but we can have many such reports running parallely in the server, and if each report conusmes more than normal heap space the entire server response would slow down, hence looking for a better solution.

Reg: release the memory, tried calling System.gc() after reaching a certain number, but this is taking time to finish off the complete process.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if you *must* keep everything in memory, I'm not sure what else you could do.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic