Bug 38632

Summary: java.lang.OutOfMemoryError
Product: POI Reporter: Elmira <Elmira.Andreeva>
Component: HSSFAssignee: POI Developers List <dev>
Severity: normal CC: c
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: AIX   

Description Elmira 2006-02-13 15:10:31 UTC

you have a great library, but i have a problem when try to generate XLS file 
with a lot of records.

Could you please help me to investigate the problem of 
java.lang.OutOfMemoryError: I use your library to generate XLS file with about  
60 * 1000 records.

When I use method write(OutputStream stream) of the class 
org.apache.poi.hssf.usermodel.HSSFWorkbook, I receive OutOfMemory Error.
But it's work when I generate XLS files with about 500 records.

As I view, the such problem was discussed here and your team suggested to 
increase JVM memory size. But my settings for JVM is: Xms512m -Xmx1024m and I 
if you suggest me to increase it, I can't do it.

I use AIX, Java 1.4.

Thank you!
Hope to hear from you soon.

Please view stack trace of the exception:

[2/10/06 14:50:22:640 MST] 28292a11 WebGroup      E SRVE0026E: [Servlet Error]-
[JVMXE006:OutOfMemoryError, stAllocArray for executeJava failed]: 
java.lang.OutOfMemoryError: JVMXE006:OutOfMemoryError, stAllocArray for 
executeJava failed
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.getBytes
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.write
Comment 1 Srinivasa Doradla 2007-02-21 07:27:38 UTC
i m also getting Outofmemory issue in my application while writing more than 
65000 rows in the excel file. It is not possible to increase my heap size in 
the application. So please Update to me how to proceed.
Comment 2 Andy Oliver 2007-02-21 13:09:41 UTC
I'm sorry that POI is taking too much memory for you.  This is not a bug.  It is
also NOT a blocker for POI. A sensible thing to do would be to ask on the mail
list too rather than filing or attaching to already meaningless bugs with
further meaningless me-tos. 
Comment 3 Carmen Alvarez 2013-08-18 13:25:15 UTC

I'm sorry about resurrecting this thread from 6 years ago, just to add a "me too".  But I am having this problem as well (the same stacktrace).  I cannot increase the heap size, as I am attempting to export an Excel file from an Android device.  I had hoped to switch from JXL to POI because it seems that POI is better maintained.  Both libraries had OutOfMemoryErrors when creating a large Excel file.  JXL has an option to not load everything in memory, but to use a temporary file.  Using this option solved this issue using that library.

So I'm wondering if this could indeed be a bug in POI that could be resolved by using a temporary file instead of memory.

Could you please elaborate with a bit more details, if this is really not a bug?

Comment 4 Nick Burch 2013-08-18 16:28:20 UTC
Please ask all usage questions on the mailing list - http://poi.apache.org/mailinglists.html - bugzilla is not the place to ask for help