• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Heap Dump Issue POI Jar

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 688
Mac
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Just the other day, I was thinking ... about this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic