JBAS-3016 - Memory Leaks on redeployments
clebert.suconic Apr 3, 2006 4:31 PMI just made dcl a WeakReference on AOPClassPool.
Had to make dcl private, and make it a WeakReference.
but that didn't solve the leak. There are still StrongReferences through reflection.
Look at org.jboss.aop.MethodJoinPoint sourceCode for instance.
/** * This class is here to eliminate a hash lookup in invokeMethod */ public class MethodJoinPoint extends JoinPoint { public Method advisedMethod; public Method unadvisedMethod;
also, something caught my attention.
After running AOPTestCase (from jboss-head/testsuite)
org.jboss.test.aop.bean.POJOWildCardConstructorInterceptor had an impressive number of InstanceOf references.
So, It looks this is not just leaking Classes references, but it might also have some Object leaks.
org.jboss.mx.loading.UnifiedClassLoader3@4373267 !--- class org.jboss.aop.advice.org.jboss.test.aop.bean.Aspect15 !--- !--- [Ljava.lang.Object;@14123321 !--- !--- !--- java.util.Vector@22053093 !--- !--- !--- !--- org.jboss.mx.loading.UnifiedClassLoader3@4373267 !--- !--- !--- !--- !--- class org.jboss.test.aop.bean.POJOWildCardConstructorInterceptor !--- !--- !--- !--- !--- !--- class java.lang.Class !---!---!---!---!---!---!---Root Detail !---!---!---!---!---!---!---Root Detail !---!---!---!---!---!---!---Root Detail !---!---!---!---!---!---!---Root Detail Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@7262684 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@26471365 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@6021288 Detail !---!---!---!---!---!---!--- FieldReference private final java.lang.Class java.io.ObjectStreamField.type=java.io.ObjectStreamField@24426889 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@4256497 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@907380 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@16012915 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@22527606 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@26832405 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@678620 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@30625452 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@30541393 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@27061842 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@31617094 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@20519468 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@31805111 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@26411145 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@549050 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@419018 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@29570270 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@16737727 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@24188282 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@20516810 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@20687062 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@29996737 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@33386806 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@1293396 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@28404046 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@7911461 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@25268918 Detail !---!---!---!---!---!---!---InstanceOfReference:ToString=[Ljava.lang.Class;@29827550 Detail ... there are more... I had to cut the report here, or it would be too big otherwise