-
1. Re: Memory leak when using JbossCache and JOTM
brian.stansberry Mar 14, 2007 12:57 PM (in response to atijms)Does the reference chain from the JOTM object lead through a javax.transaction.Synchronization implementation? For example, org.jboss.cache.interceptors.TxInterceptor$RemoteSynchronizationHandler (or TxInterceptor$LocalSynchronizationHandler)?
If not, please post the full reference chain.
If so, two possibilites:
1) JOTM is holding onto the ref to the Synchronization for a little while, but will eventually clean it up and your object will be gc'd.
2) JOTM is holding a ref to the Synchronization and won't ever release it. That would be a bug in JOTM.
See http://www.jboss.com/index.html?module=bb&op=viewforum&f=164 for a question I raised with our transaction gurus that deals with a strategy we could employ to aggressively cut the reference chain. -
2. Re: Memory leak when using JbossCache and JOTM
atijms Mar 14, 2007 1:50 PM (in response to atijms)"bstansberry@jboss.com" wrote:
Does the reference chain from the JOTM object lead through a javax.transaction.Synchronization implementation? For example, org.jboss.cache.interceptors.TxInterceptor$RemoteSynchronizationHandler (or TxInterceptor$LocalSynchronizationHandler)?
Yes it does. Just for clarity I'll post the whole reference chain anyway:[sticky class] (jprofiler term.) | class com.sun.corba.se.impl.util.Utility | com.sun.corba.se.impl.util.IdentityHashtable | <class>[] | com.sun.corba.se.impl.util.IdentityHashTableEntry | org.objectweb.jotm.SubCoordinator | java.util.Vector | <class>[] | org.jboss.cache.interceptors.OrderedSynchronisationHandler | ... | org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler | org.jboss.cache.TransactionEntry | ... | org.jboss.cache.marshall.JBCMethodCall | <class>[] | [the object I put into JBossCache]
2) JOTM is holding a ref to the Synchronization and won't ever release it. That would be a bug in JOTM.
This is what is currently happening, as I don't think "for a little while" means atleast a few hours ;)
I'm going to read the link you posted. Meanwhile I'm also reading through JOTM's sourcecode to see if it's anything trivial to fix (but I'm afraid it isn't). -
3. Re: Memory leak when using JbossCache and JOTM
brian.stansberry Mar 14, 2007 2:43 PM (in response to atijms)See http://jira.jboss.com/jira/browse/JBCACHE-1007 for a JIRA that will break the reference chain from the Synchronization back to your object.
If JOTM is not fixable, it should be fairly straightforward for you to patch your JBoss Cache instance.