You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "HODAC, Olivier" <OL...@airbus.com> on 2011/02/16 10:14:52 UTC

closing a hssfworkbook

Hello,

I am new in using POI and I am wondering how resources are released when I open a new workbook using
                hssfWorkbook = new HSSFWorkbook(new FileInputStream(templateFolder+"/"+templateName));

I do not see any close() method. It means that the xsl file is released when the workbook is killed by the garbage collector? Is it a copy? I have a large file to open, hssWorkbook is a field of a class I keep during all the session. Is it a mistake? My java process seems to consume a lot of RAM.

One other question, I open several workbooks, and I suspect the POI processes to run iexplore that consumes a*lot* of CPU. Is there a link?

Thank's


The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.


Re: closing a hssfworkbook

Posted by Nick Burch <ni...@alfresco.com>.
On Wed, 16 Feb 2011, HODAC, Olivier wrote:
> I am new in using POI and I am wondering how resources are released when 
> I open a new workbook using
>   hssfWorkbook = new HSSFWorkbook(new FileInputStream(templateFolder+"/"+templateName));

The input stream will be closed for you by default (see the constructor 
javadocs).

> I do not see any close() method. It means that the xsl file is released 
> when the workbook is killed by the garbage collector?

Yup. When you're done, just null your objects / let them go out of scope

> One other question, I open several workbooks, and I suspect the POI 
> processes to run iexplore that consumes a*lot* of CPU. Is there a link?

POI is pure java, and doesn't touch internet explorer in any way...

Nick

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


RE: closing a hssfworkbook

Posted by "HODAC, Olivier" <OL...@airbus.com>.
Thank's

-----Message d'origine-----
De : Nick Burch [mailto:nick.burch@alfresco.com] 
Envoyé : mercredi 16 février 2011 13:56
À : POI Users List
Objet : Re: closing a hssfworkbook

On Wed, 16 Feb 2011, HODAC, Olivier wrote:
> I am new in using POI and I am wondering how resources are released when 
> I open a new workbook using
>   hssfWorkbook = new HSSFWorkbook(new FileInputStream(templateFolder+"/"+templateName));

The input stream will be closed for you by default (see the constructor 
javadocs).

> I do not see any close() method. It means that the xsl file is released 
> when the workbook is killed by the garbage collector?

Yup. When you're done, just null your objects / let them go out of scope

> One other question, I open several workbooks, and I suspect the POI 
> processes to run iexplore that consumes a*lot* of CPU. Is there a link?

POI is pure java, and doesn't touch internet explorer in any way...

Nick

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


This mail has originated outside your organization, either from an external partner or the Global Internet.
Keep this in mind if you answer this message.



The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.


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