Bug 34067 - OutOfMemoryError w/ Certain excel files
Summary: OutOfMemoryError w/ Certain excel files
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.5-FINAL
Hardware: Other AIX
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2005-03-18 03:38 UTC by Bob White
Modified: 2005-03-18 03:03 UTC (History)
0 users

Example of excel file that reliably fails with OutOfMemoryError (872.76 KB, application/vnd.ms-excel)
2005-03-18 03:46 UTC, Bob White

Note You need to log in before you can comment on or make changes to this bug.
Description Bob White 2005-03-18 03:38:20 UTC
I have several Excel files that throw OutOfMemoryError.  Error is reliably
repeatable.  They also seem to take an inordinate amount of time to load before
failing.  This does not happen with smaller size files, hence, I suspect it is a
file format problem.  I do not know what version of Excel is used to create
these files (we are emailed such a data file every day).  I will attempt to
attach an example of a failing file.  Failure occurs in HSSFWorkbook
constructor, called as shown below.

  public XlsHssfWorkbook( final File f ) throws IOException
    boolean bComplete = false;
    _fis = new FileInputStream( f );
      _fs = new POIFSFileSystem( _fis );
      _workbook = new HSSFWorkbook( _fs );
      bComplete = true;
      if ( !bComplete )
Comment 1 Bob White 2005-03-18 03:46:07 UTC
Created attachment 14516 [details]
Example of excel file that reliably fails with OutOfMemoryError

Zipped version of Excel file
Comment 2 Andy Oliver 2005-03-18 04:53:28 UTC
Up your heap size (-Xmx384m for instance would make it 384mb).  It makes total
sense that it would get dog slow before dying...its the garbage collector trying
to make due.
Comment 3 Bob White 2005-03-18 12:03:37 UTC
Could it really be that simple?  Did I just need to increase my JVM max heap
size? Yes, it was that simple.  -Xmx128m did the trick.  Never mind.