Hi all
I have this problem: after certain time of using a web app, it exhausts the heap. I profiled it and it shows two classes which instances are consuming most of the heap space:
- java.util.HashMap$Entry
- java.lang.reflect.Method
Inspecting the GC path of the first I found that CGLIB proxies are holding the references of most of them. (*)
I tested this scenario:
1 - Use the application throw a web browser
2 - Check the memory. I see at this point that heap usage increases
3 - Close the browser
4 - When there's no more activity, I ran the GC manually, through the profiler
When I perform this last step I can see that memory isn't released, which leads me to think that proxies and its inner instances are still referenced.
(*) The reference chain is:
CGLIB$CALLBACK_0 of net.aper.olimpo.jano.proxy.Proxy$$EnhancerByCGLIB$$a83995b2 [Held by JVM] --> targetObject of net.aper.olimpo.cronos.hibernate.proxies.HibernateCollectionProxy -->
map of java.util.HashSet --> set of org.hibernate.collection.PersistentSet --> table of java.util.HashMap --> [12] of java.util.HashMap$Entry[17] --> java.util.HashMap$Entry
The environment is:
- Tomcat 5.5
- Hibernate 3.1.3
- CGLIB 2.1.3
- JDK 1.5
I tried upgrading to Hibernate's latest version but I wasn't able to get it working. It throws a NPE at:
javassist.util.proxy.RuntimeSupport$DefaultMethodHandler.invoke(RuntimeSupport.java:37)
net.aper.crm.blb.segmentation.segment.EntityType_$$_javassist_47.getHibernateLazyInitializer(EntityType_$$_javassist_47.java)
org.hibernate.Hibernate.isInitialized(Hibernate.java:344)
I've read all the info I was able to find in this forum and others and couldn't solve the issue.
|