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]

Reply via email to