You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by "Joseph D. Wagner" <th...@josephdwagner.info> on 2011/02/03 00:19:53 UTC

Re: OutOfMemoryError while writing a large xlsx file

On 01/24/2011 11:05 AM, 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.
ElementXobj is an inner class of the abstract class Xobj, defined in:
xmlbeans/src/store/org/apache/xmlbeans/impl/store/Xobj.java

I've noticed it doesn't override equals or hashCode.  It's my 
understanding that the garbage collector uses hashCode to determine when 
an object is eligible for collection.  Without an override, the garbage 
collector may be missing some opportunities.

Can someone confirm if my understanding of the garbage collector 
correct?  I'm new at this, and I don't want to take what I think is an 
issue to the XmlBeans group only to look like an idiot.

Thanks.

Joseph D. Wagner

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: OutOfMemoryError while writing a large xlsx file

Posted by Nick Burch <ni...@alfresco.com>.
On Wed, 2 Feb 2011, Joseph D. Wagner wrote:
> I've noticed it doesn't override equals or hashCode.  It's my 
> understanding that the garbage collector uses hashCode to determine when 
> an object is eligible for collection.

Not sure most of the garbage collectors do, though the lack of methods 
could potentially slow down certain list/map/lookup operations

I'm sure there was a good talk at ApacheCon in Atlanta a few months back 
that covered the garbage collector in good detail, but annoyingly I've 
forgotten who gave it so I can point you at it... This blog post looks 
fairly good though:
http://techfeast-hiranya.blogspot.com/2010/11/taming-java-garbage-collector.html

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org