Bug 33250

Summary: Out of Memory Error while Stress Testing
Product: POI Reporter: Sumit Machwe <sumit_machwe>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P3    
Version: 2.5-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   

Description Sumit Machwe 2005-01-26 18:02:49 UTC
Hi,
My application uses POI to generate MS Excel Workbooks. Average Size of a 
Workbook is 30 Col X 1000 Rows X 25 Worksheets (file size is approx 5-6 MB). 
 
While doing a stress testing with 30 Concurrent user load, application started 
throwing java.lang.OutfMemoryError
We noticed that there was a Heap Dump and the available memory did not return 
back to normal. It has been noticed that  
org.apache.poi.hssf.usermodel.HSSFSheet objects are taking almost 100 MB space.

Details of development environment are:
#JVM IBM (Wepsphere application Server 5.1)
#2 GB available memory (Dedicated)before starting the stress test.
#Initial heap size, as set by -Xms paramters is set to 256M.

Stress testing process is pretty decent and it closes all 30 sessions after 
the excel file is generated in each one of them.. so I don't suspect 
application holding any large objects for a long duration. 

Please adivce if this is a known issue with HSSF.
Comment 1 Avik Sengupta 2005-01-27 06:52:02 UTC
What was max heap size? 2GB?

In any case, a POI HSSF workbook takes a substantial amount of memory. Reading
and writing take additional memory since it has to be done in-memory. Therefore,
Out of Memory in concurrent access cannot be considered a bug. If, however, you
find memory LEAKS (ie, all memory should be reclaimed by the GC AFTER you loose
a reference to a workbook) then that is certainly a bug. 

There is, of course, a long running feature request to reduce memory usage, but
that's waiting for contributions!
Comment 2 Avik Sengupta 2005-01-27 06:52:38 UTC
What was max heap size? 2GB?

In any case, a POI HSSF workbook takes a substantial amount of memory. Reading
and writing take additional memory since it has to be done in-memory. Therefore,
Out of Memory in concurrent access cannot be considered a bug. If, however, you
find memory LEAKS (ie, all memory should be reclaimed by the GC AFTER you loose
a reference to a workbook) then that is certainly a bug. 

There is, of course, a long running feature request to reduce memory usage, but
that's waiting for contributions!