Maksim
Maksim

Reputation: 16931

Class Loading problem in Java Enterprise application

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.

Upvotes: 3

Views: 210

Answers (3)

Yardena
Yardena

Reputation: 2847

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.

Upvotes: 2

javashlook
javashlook

Reputation: 10471

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.

Upvotes: 0

Tom Hawtin - tackline
Tom Hawtin - tackline

Reputation: 147164

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.

Upvotes: 0

Related Questions