Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring CGLIB perm gen heap memory issue

 
John Hall
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any help here??
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
John Hall
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic