ClassLoader and probable memory leak in ReusableObjectInputStream
-----------------------------------------------------------------
Key: JBCACHE-1325
URL:
http://jira.jboss.com/jira/browse/JBCACHE-1325
Project: JBoss Cache
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 2.1.0.GA
Reporter: Brian Stansberry
Assigned To: Manik Surtani
Priority: Critical
Fix For: 2.1.1.GA
java.io.ObjectInputStream maintains an internal table of objects it has deserialized. If
you don't close the stream (i.e. try to reuse it) that table doesn't get cleared.
A classloader leak analysis I'm doing shows this as a cause of a classloader leak;
looking at the java.io.ObjectInputStream code's use of its HandleTable inner class
makes me think not closing the stream is very likely a memory leak as well.
Reference chain leading to a leaked classloader:
!--BaseClassLoader@7441b1fd{vfsfile:/home/bes/dev/jboss/trunk/testsuite/output/lib/cluster-clleak-field.war}
!--!--ClassLoaderReference @ class org.jboss.test.cluster.web.aop.Person
!--!--!--arrayRef [Ljava.lang.Object;[23] id=@1804215529
!--!--!--!--FieldReference java.lang.Object[]
java.io.ObjectInputStream$HandleTable.entries=java.io.ObjectInputStream$HandleTable@254ca71
!--!--!--!--!--FieldReference
UndefinedField@org.jboss.cache.marshall.io.ReusableObjectInputStream@3274ae84=org.jboss.cache.marshall.io.ReusableObjectInputStream(a)3274ae84
!--!--!--!--!--!--FieldReference volatile java.lang.Object
java.util.concurrent.LinkedBlockingQueue$Node.item=java.util.concurrent.LinkedBlockingQueue$Node@185d3a64
!--!--!--!--!--!--!--FieldReference private transient
java.util.concurrent.LinkedBlockingQueue$Node
java.util.concurrent.LinkedBlockingQueue.last=[org.jboss.cache.marshall.io.ReusableObjectInputStream@59e8f902,
org.jboss.cache.marshall.io.ReusableObjectInputStream@4e34206b,
org.jboss.cache.marshall.io.ReusableObjectInputStream@403c78e9,
org.jboss.cache.marshall.io.ReusableObjectInputStream@422629f1,
org.jboss.cache.marshall.io.ReusableObjectInputStream@578baf24,
org.jboss.cache.marshall.io.ReusableObjectInputStream@13979163,
org.jboss.cache.marshall.io.ReusableObjectInputStream@43ca04a1,
org.jboss.cache.marshall.io.ReusableObjectInputStream@3f608cc,
org.jboss.cache.marshall.io.ReusableObjectInputStream@dbb8b1c,
org.jboss.cache.marshall.io.ReusableObjectInputStream@13a9e24f,
org.jboss.cache.marshall.io.ReusableObjectInputStream@7648ba9e,
org.jboss.cache.marshall.io.ReusableObjectInputStream@20d417bd,
org.jboss.cache.marshall.io.ReusableObjectInputStream@44628a21,
org.jboss.cache.marshall.io.ReusableObjectInputStream@215a9f9a,
org.jboss.cache.marshall.io.ReusableObjectInputStream@44a44891,
org.jboss.cache.marshall.io.ReusableObjectInputStream@7d984acb,
org.jboss.cache.marshall.io.ReusableObjectInputStream@195695d8,
org.jboss.cache.marshall.io.ReusableObjectInputStream@387a4e7,
org.jboss.cache.marshall.io.ReusableObjectInputStream@3e5b3b80,
org.jboss.cache.marshall.io.ReusableObjectInputStream@579f707b,
org.jboss.cache.marshall.io.ReusableObjectInputStream@2491c82e,
org.jboss.cache.marshall.io.ReusableObjectInputStream@5eed56c3,
org.jboss.cache.marshall.io.ReusableObjectInputStream@2fdb4ce5,
org.jboss.cache.marshall.io.ReusableObjectInputStream@669566ee,
org.jboss.cache.marshall.io.ReusableObjectInputStream@5a98c7df,
org.jboss.cache.marshall.io.ReusableObjectInputStream@646a2ff0,
org.jboss.cache.marshall.io.ReusableObjectInputStream@77716910,
org.jboss.cache.marshall.io.ReusableObjectInputStream@36a8d6b3,
org.jboss.cache.marshall.io.ReusableObjectInputStream@6a79dce,
org.jboss.cache.marshall.io.ReusableObjectInputStream@666942cb,
org.jboss.cache.marshall.io.ReusableObjectInputStream@8a051f4,
org.jboss.cache.marshall.io.ReusableObjectInputStream@55646e98,
org.jboss.cache.marshall.io.ReusableObjectInputStream@3498e8f4,
org.jboss.cache.marshall.io.ReusableObjectInputStream@22e60626,
org.jboss.cache.marshall.io.ReusableObjectInputStream@2b9dbab0,
org.jboss.cache.marshall.io.ReusableObjectInputStream@4b8f2f,
org.jboss.cache.marshall.io.ReusableObjectInputStream@60a556cf,
org.jboss.cache.marshall.io.ReusableObjectInputStream@6e6619b,
org.jboss.cache.marshall.io.ReusableObjectInputStream@7f120aa6,
org.jboss.cache.marshall.io.ReusableObjectInputStream@79795976,
org.jboss.cache.marshall.io.ReusableObjectInputStream@de09048,
org.jboss.cache.marshall.io.ReusableObjectInputStream@12206e16,
org.jboss.cache.marshall.io.ReusableObjectInputStream@f1b6fa6,
org.jboss.cache.marshall.io.ReusableObjectInputStream@523f0309,
org.jboss.cache.marshall.io.ReusableObjectInputStream@26e06e0e,
org.jboss.cache.marshall.io.ReusableObjectInputStream@58596d12,
org.jboss.cache.marshall.io.ReusableObjectInputStream@5707e60e,
org.jboss.cache.marshall.io.ReusableObjectInputStream@4790cdc5,
org.jboss.cache.marshall.io.ReusableObjectInputStream@73b56537,
org.jboss.cache.marshall.io.ReusableObjectInputStream@3274ae84]
!--!--!--!--!--!--!--!--FieldReference java.util.concurrent.BlockingQueue
org.jboss.cache.marshall.io.ObjectStreamPool.inputStreams=org.jboss.cache.marshall.io.ObjectStreamPool@21e513fb
!--!--!--!--!--!--!--!--!--FieldReference org.jboss.cache.marshall.io.ObjectStreamPool
org.jboss.cache.marshall.VersionAwareMarshaller.pool=org.jboss.cache.marshall.VersionAwareMarshaller@37760a63
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira