views:

117

answers:

3

I have Enterprise Application with EJB3 and JSF on Glassfish server. After running this application for more than 2 weeks I realized that I have problem with Class Loading. I don't think this is a problem with permgen. The classes loaded every time when I open a page but then they never erased from the memory. Here is the snapshot of or my server's memory:

Snapshot

So, i just need some pointers of how I can debug this problem.

+1  A: 

There's a nice explanation of why this sort of things happen, and a more recent account of similar problem here.

Using jhat might help to find out what classes are occupying the memory, and then look for a static reference that may hold them/or the classloader, preventing proper unloading.

Yardena
Doesn't look like a burst of an application reload.
Tom Hawtin - tackline
A: 

It doesn't look like you are reloading your application, which would be the obvious answer. Really you want to find out what those classes are.

Reflection and XSLT[C] are obvious targets for creating classes, but this seems incredibly regular. Presumably there is some time based cache somewhere that is leaking in some way.

Tom Hawtin - tackline
A: 

This could be an issue with your JSF Web framework (MyFaces, ICEFaces etc.), if you're using one. Especially given the fact that you're not redeploying the application, but this happens when pages are opened/closed. I suggest that you check the appropriate issue tracker, before doing more debugging and profiling.

Also, you can try to deploy the application on your local machine, with intentionally low heap space, and attempt to reproduce the memory leaking consistently by only navigating through the Web pages of the application. Hopefully, you'll be able to exactly realize what kind of action results in new classes being loaded.

javashlook