[jboss-user] [JBoss Seam] - Seam apps leaking memory?!

stephen.friedrich do-not-reply at jboss.com
Mon May 7 15:08:31 EDT 2007

My (not so large) app can be redeployed on JBoss 4.0.5 exactly two times before the deployment is failing.

I know that the issue of OOME in PermGenSpace has been discussed before and the default answers were either "Sun JVM bug", "use jrockit" (which only increases the available redeploys a little without really solving the problem) or "increase perm space" (dito, I manage up  to four redeploys).

I don't really buy any of thse answers because other apps do not have such severe problems.
Here's a nice summary:

Using Yourkit I tried to investigate the problem:

  | * Started JBoss.
  | * Deployed the booking app.
  | * Undeployed the booking app.
  | * Looked at instances of org.jboss.seam.* classes.

I have found these two problems:

  | *  java.beans.Introspector leaks if flushCaches() isn't called. For testing I added such a call in org.jboss.seam.servlet.SeamListener.contextDestroyed()
  | *  The cache used in javassist's ProxyFactory is never cleared. I updated javassist to version 3.4 and added "ProxyFactory.useCache = false;" to org.jboss.seam.servlet.SeamListener.contextInitialized()
  | I doubt that this is the correct way, but it brought down the instance count and did not seem to break anything. (javassist's ProxyFactory is used from org.jboss.seam.Component.createProxyFactory().)

These changes reduced the instance count but there are still some objects that refuse to get collected. I am stuck: All references to remaining objects come from the UnifiedClassLoader3. 
Looks like "org.jboss.util.timeout.TimeoutFactory$1" is still holding a strong reference to the class loader.

This is well out of my expertise. I'd really appreciate if somebody could look into that.[/url]

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043738#4043738

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043738

More information about the jboss-user mailing list