On Mon, 24 Jan 2011, Wessel van Norel wrote:
The biggest object is: org.apache.poi.xssf.usermodel.XSSFSheet. This
sheet is 2Gb in size. It contains almost 2 million
org.apache.xmlbeans.impl.store.Xobj$ElementXobj objects, totalling
1.7Gb in heap space retained.

Are you using the full ooxml-schemas jar, or the ooxml-lite one? If memory serves, they should have the same memory footprint (though that's worth double checking!), but the ooxml-schemas one should have more helpful classnames in it.

Any chance you could double check with the footprint of the two ooxml schemas jar (full and lite) on the memory footprint, and also see if the class names are more specific about the memory use on the full schema case?

(If it isn't more specific, can you drill down to try to find out what xml element(s) are mostly being used by the Xobjs)


Unfortunately I've no experience, yet, with writing XML files using XMLBeans. So I'm not sure if it's doing it the SAX or DOM way when writing XML files. But looking at the memory usage, my first guess would be that it's doing it the DOM way.

as memory serves, what happens is that the XSSF usermodel has an xssf specific object for most of the key parts (row, cell, style etc), and a backing xmlbeans object. Most reads and writes go through the XSSF class and read/write from the underlying xmlbeans object. At write time, xmlbeans serialises from the DOM view of its classes.

(For HSSF, there's a similar situation with HSSF usermodel classes and the underlying HSSF records)


Quick check - is there much memory difference between when you've built the sheet, and when you're writing it out? i.e. is it the process of building the huge sheet that takes all the memory, or does memory use peak when writing it out to the stream?

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to