Bug 57292

Summary: APache POI 3.9 work
Product: POI Reporter: Suyog <suyogkasawa2007>
Component: POI OverallAssignee: POI Developers List <dev>
Severity: blocker    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description Suyog 2014-12-01 11:22:02 UTC
Hi All,

Below is my code to read xlsm file :

byte[] filedata = attachmentValue.getFileData();
			InputStream inputFileStream = new ByteArrayInputStream(filedata);
	        //Create Workbook instance for xlsx/xls file input stream
	        Workbook workbook = null;

  workbook = WorkbookFactory.create(inputFileStream);

This code work well upto 5 MB. But after that throwing Out Of Memory Exception.

I am using POI 3.9 jars

Please suggest.
Comment 1 Nick Burch 2014-12-01 13:06:47 UTC
This should be covered in this FAQ Entry - http://poi.apache.org/faq.html#faq-N10109
Comment 2 Suyog 2014-12-01 16:29:29 UTC
Heap dumps are getting genarted :

A Linked List Data Structure Detected.
 466,985,128 bytes (51.13 %) of Java heap is used by 489,034 instances of org/apache/xmlbeans/impl/store/Xobj$ElementXobj
 Contains 3 types of the following objects:
 - 489,034 instances of javax/xml/namespace/QName holding 39,122,672 bytes
 - 489,035 instances of org/apache/xmlbeans/impl/store/Xobj$AttrXobj holding 43,037,568 bytes
 - 489,034 instances of org/apache/xmlbeans/impl/store/Locale holding 684,647,600 bytes