Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Heap Dump Issue POI Jar  RSS feed

 
Ankur Dhawan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am using poi.jar to read and write data in excel sheet. There are no issues in this, but when we run the process for the whole data it keeps on wriring on the heap of the server and after some time it gives us out of memory exception. I increased the maximum size of heap on the server, it solves the problem, but this is a temporary way out of this issue. Please let me know if any one is having solution of this problem or if this is a issue with the poi.jar.

Thanks n Regards
Ankur Dhawan
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankur,

You should use a profiling tool to check for memory leaks. It will help you identify what objects are not being gc'd.

I've used the Java Heap Analysis Tool (HAT). It's not fancy, but it's free and works.

Profilers are available for Eclipse and Netbeans.

There was a thread on Slashdot recently about selecting a profiling tool.

Once you've identified the objects that are not being garbage collected, do a code review to trace the lifetime of those objects. Ensure that all references to the object are released when the object is no longer needed.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
POI is known to consume large amounts of memory. You might test-drive jExcelApi as an alternative if POI continues to give you trouble.
 
Jignesh Patel
Ranch Hand
Posts: 626
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used POI and I agree with Ulf. If you process cell by cell in excel then its going to create a big memory footprint.

There is another way of doing in POI, by using low level API but it is not as wide as standard POI api, but if it can serve your purpose then its fine.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!