File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Spring CGLIB perm gen heap memory issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring CGLIB perm gen heap memory issue" Watch "Spring CGLIB perm gen heap memory issue" New topic
Author

Spring CGLIB perm gen heap memory issue

John Hall
Greenhorn

Joined: Apr 06, 2008
Posts: 15
Hi Ranchers,

We are having an out of memory issue in our application.
Environment : JBoss 6.0, Spring 3, Hibernate 3.6

We use annotation based spring bean configuration as below. We get context and close and end of the operation.

AnnotationConfigApplicationContext beanContext = new AnnotationConfigApplicationContext(BeanConfig.class);
TestDAO testDAO = beanContext .getName("testDAO")
beanContext .close();
beanContext .destroy();


But the application ends to OOM issue ( perm gen) after processing few messages.

JVM args at starting of server is below.

JAVA_OPTS=-Xms512M -Xmx768M -XX:MaxPermSize=256M -XX:+UseParNewGC -XX:MaxNewSize=256m -XX:NewSize=256m -XX:MaxTenuringThreshold=0 -XX:SurvivorRatio=128 -XX:+UseTLAB -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled

Upon analyzing heap dump with visualvm, we see lots of cglib related inner classes are not being reclaimed by GC.
class names like: BeanConfig$$EnhancerByCGLIB3232$$FastClassByCGLIB$$$

Anyone having similar issue? Any help will be highly appreciated.

Thanks,
John
John Hall
Greenhorn

Joined: Apr 06, 2008
Posts: 15
Any help here??
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

What version of CGLib are you using? If you do a web search on OutOfMemoryError FastClassByCGLIB it seems there were some versions that had a bug causing this.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
John Hall
Greenhorn

Joined: Apr 06, 2008
Posts: 15
Thanks Nathan,

We are using cglib-nodep-2.2.2.jar ( this is the latest in cglib site)

I already tried on google, but no final conclusion if we need to use differebnt cglib jar .

Environment : JBoss 6.0, Spring 3.0.5, Hibernate 3.6
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring CGLIB perm gen heap memory issue
 
Similar Threads
Java OS VM Increase
Java Private Bytes Increase
java.lang.OutOfMemoryError: Java heap space
Perm Gen Issue
GC taking lots of time