You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Antonio Gallardo <ag...@agsoftware.dnsalias.com> on 2003/12/13 10:11:39 UTC

WARN: Found unclosed resources while finalize

Hi:

I am getting this type of errors. I review the code and saw that we close
the broker on every transaction.

Can someone tell me why I am getting this errors?

[org.apache.ojb.broker.accesslayer.RsIterator] WARN: Found unclosed
resources while finalize (causer class:
org.apache.ojb.broker.accesslayer.RsIterator)

[org.apache.ojb.broker.accesslayer.ResultSetAndStatement] ERROR: **
Associated resources (Statement/ResultSet) not closed! This could lead in
leaking resources **

Best Regards,

Antonio Gallardo

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


Re: WARN: Found unclosed resources while finalize

Posted by Armin Waibel <ar...@code-au-lait.de>.
yes I read, the same story. I thought gc does finalize classes in order 
of the references, mean first gc RsIterator (finalize close all 
resources) then clean the reference to StatementAndResultSet, seems does 
not ;-).
I will set log level to info too.

Thanks for pointing to that.

regards,
Armin

Antonio Gallardo wrote:

> Hi Armin:
> 
> Thanks for the answer. Reading again the first message it is OK. Of course
> your idea to set the log level to INFO is good. I think we can set it as
> default, because we are not creating any leak at all in this case. But the
> second message:
> 
> [org.apache.ojb.broker.accesslayer.ResultSetAndStatement] ERROR: **
> Associated resources (Statement/ResultSet) not closed! This could lead
> in leaking resources **
> 
> Is cause a big alarm to me. This means the app is leaking memory or I
> don't need to care about this second message? I just want to make sure you
> read this second message too.
> 
> Best Regards,
> 
> Antonio Gallardo
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 



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


Re: WARN: Found unclosed resources while finalize

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Hi Armin:

Thanks for the answer. Reading again the first message it is OK. Of course
your idea to set the log level to INFO is good. I think we can set it as
default, because we are not creating any leak at all in this case. But the
second message:

[org.apache.ojb.broker.accesslayer.ResultSetAndStatement] ERROR: **
Associated resources (Statement/ResultSet) not closed! This could lead
in leaking resources **

Is cause a big alarm to me. This means the app is leaking memory or I
don't need to care about this second message? I just want to make sure you
read this second message too.

Best Regards,

Antonio Gallardo


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


Re: WARN: Found unclosed resources while finalize

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Antonio,

that's ok, I made these strict settings to detect possible resource 
leaks (don't panic I think we haven't). See
http://thread.gmane.org/gmane.comp.jakarta.ojb.devel/4526

Maybe it's better to change log level to 'info' before rc5 ;-)

The problem is when you obtain a RsIterator instance and start with 
iteration but cancel (stop) iteration before end the RsIterator couldn't 
close the StatementAndResultSet instance.

I like to add RsIterator as a weak "close PB or close connection" 
listener. Then RsIterator can close resources on 'close' event. If you 
don't close the PB instance, only way to free resources is gc.

Any other/better solution?

regards,
Armin

Antonio Gallardo wrote:
> Hi:
> 
> I am getting this type of errors. I review the code and saw that we close
> the broker on every transaction.
> 
> Can someone tell me why I am getting this errors?
> 
> [org.apache.ojb.broker.accesslayer.RsIterator] WARN: Found unclosed
> resources while finalize (causer class:
> org.apache.ojb.broker.accesslayer.RsIterator)
> 
> [org.apache.ojb.broker.accesslayer.ResultSetAndStatement] ERROR: **
> Associated resources (Statement/ResultSet) not closed! This could lead in
> leaking resources **
> 
> Best Regards,
> 
> Antonio Gallardo
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 



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