PDA

View Full Version : when webapps do not unload...


kjkoster
20-07-2008, 00:22
Dear All,

Just a quicky today. I found a nice collection of possible causes of memory leaks in your application servers in this article (http://opensource.atlassian.com/confluence/spring/pages/viewpage.action?pageId=2669). I'm sure that many of you are familiar with the dreaded OutOfMemoryException while redeploying applications.

What causes for web applications not unloading have you encountered?

Kees Jan

Tobias
23-07-2008, 20:26
One client one reported problems when sending Hibernate Entities (with proxies) through a JMX queue as a Java object. Not exactly a redeployment problem but leaking perm space never the less.

kjkoster
23-07-2008, 20:55
Did it leak on the sending side, or on the receiving side of the queue? (I assume you meant to say JMS queue?).

Tobias
23-07-2008, 21:05
Yep, JMS :-)
The application was on the sending and receiving end. So it was hard to tell :-)

Barry
24-07-2008, 10:14
One client one reported problems when sending Hibernate Entities (with proxies) through a JMX queue as a Java object. Not exactly a redeployment problem but leaking perm space never the less.

Hi,

Could this be because RMI is used to serialize the classes and data from a separate thread? Whenever you start moving things through JMX, funky interactions can happen as you are now accessing state in your application from threads that run in the server/jvm space and not just in the application. (which means you hold on resources preventing garbage collection)

andrejk
24-07-2008, 21:23
I've run into permspace problems a couple of time, when developing applications, or just redeploying large applications.
I think the cause is mentioned on the page you link to, but as i understand it the following is happening:
* Classes are loaded into permspace (code, not data).
* When you change the code at runtime, eg by using a byte code editor (aop weaving, etc), you create a unique class.
* When you reload the application, the old classes aren't replaced by the new classes, as they have become unique by the runtime changes, so they remain in permspace.
* So with every reload you use more permspace.

Only fix: increase permspace so you don't have to restart the application server as often.

Regards,
Andrej