Hi Danilo, Bob,

AFAIK there was no patch checked in conjunction with PBThreadMapping. As you said the threads in tomcat will be recycled and it seems that ThreadLocal will cause a memory leak in this case:
http://www.jroller.com/page/tackline/20050310
(sounds similar, but maybe I'm wrong)

So we need some kind of shutdown method in PBF and in PBThreadMapping. Could you both summarize the needed changes I will check in a patch. I found the patch for PBThreadMapping (the new "shutdown"-method). What's needed too?

regards,
Armin

Danilo Tommasina wrote:
Hello,

please see my post 'ThreadLocal causing memory leak' of 9. Jun. 2005, this is 
the same problem described there.
I posted some code that can be used as temporary solution or workaround and 
discussed a bit about the issue with Martin Kalén, however I do not know the 
current
status...

Both the workaround in the PersistenceBrokerFactoryDefaultImpl and my proposed 
'clean' solution in the PersistenceBrokerThreadMapping (I sent the definitive
code directly to Martin) seems to work correctly in our application. To note is 
that we are using only the PB API and are not using proxies.
The workaround in the PersistenceBrokerFactoryDefaultImpl 'may' cause problems 
or performance issues with proxies, however I cannot test it, I did just a short
and not very deep analysis of the code searching for possible side effects.

As I cannot currently access the apache CVS (it seems to be flooded and it is 
currently down), I cannot say if the issue has already been patched in the 
latest
CVS version or not.

bye
Danilo

Glugla, Robert T wrote:

Environment:

OJB:            1.0.3
JProfiler:      4.0.1
Tomcat:         5.0.19
JVM:            Sun 1.4.2_06-b03

While profiling our OJB application, we noticed that after we shut it
down in Tomcat, we had plenty of org.apache.ojb.broker.* and
org.apache.ojb.metadata.* objects left behind in memory. Using JProfiler
we tracked it down to several static variables not getting cleared out
including:

PersistenceBrokerFactoryFactory.singleton
MetadataManager.singleton
...several others...

Does anyone have any suggestions as to how to clean these up properly? I
looked for destroy methods and couldn't find any. As a test, I
downloaded the OJB source and added destroy methods to
PersistenceBrokerFactoryFactory & MetadataManager that I called from a
context listener and it worked ok. Really, really  don't want to do this
myself. I'm guessing I'm just overlooking some easy way for cleaning
these up already provided in OJB.

Any suggestions?

Thanks.

Bob Glugla
Boeing

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[EMAIL PROTECTED]
www.risksys.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to