Java HotSpot 1.6 VM garbage collection - scary PermGen

My application shows an increase in the size of the Old Generation / Intentional Generation, and when it reaches the maximum limit for the Old Generation, then the PermGen size suddenly increases. Here are the numbers of my generation:

-Xmx1200m -Xms1200m -Xmn450m -XX:MaxPermSize=600m -XX:+UseParallelGC 

This is on 32-bit Fedora, so there can be no more heaps than this.

The application does not fancy class loading, although it uses Spring IOC and Hibernate, Spring App-context.xml defines about 1000 Beans.

This application starts with 175MB PermGen, which gradually grows to ~ 250 MB in a few hours, stays that way until Tenured Generation reaches ~ 780 MB, and then moves to ~ 500 MB, and the old Gen up to 500 MB.

This makes me restart the application on a daily basis and gives me a real frightening impending OutOfMemory error .. Any ideas would be very helpful.

Thanks Gala101

May 13: Can anyone shed light on what happens when the “old general” collects the garbage?

Does jvm collect collections from the "old generation" in PermGen?

My PermGen surge only occurs when the collection comes from the “old generation”, and also decreasing the size of OldGen closely matches the increase in PermGen size.
PS: I am not involved in real-time deployment / deployment, as this necessarily eats up PermGen.
Below is the current prospectus from my monitoring page: (the fixed part just jumped from ~ 250 MB to 500 MB).

  PS Perm Gen Type Non-heap memory Usage init = 16777216(16384K) used = 254453736(248489K) committed = 504954880(493120K) max = 629145600(614400K) Peak Usage init = 16777216(16384K) used = 254453736(248489K) committed = 504954880(493120K) max = 629145600(614400K) Collection Usage init = 16777216(16384K) used = 252421536(246505K) committed = 504954880(493120K) max = 629145600(614400K) 
+7
java garbage-collection jvm permgen
source share
3 answers

I followed leonm's advice for analyzing what takes up so much memory. I'm sure you have some kind of nasty memory leak.

You say that you are not doing any cool loading of classes, but Hibernate generates some classes on the fly for you. Do you use some AOP functions (for example, from Spring AOP module?).

Basically, if you run out of PermGen space, then it looks like your application continues to create new classes (because these are classes that are stored in PermGen).

+2
source share

Use jmap to dump memory before rebooting the server and parse with Eclipse MAT

0
source share

Permgen gets a leak if you continue to deploy / deploy applications on the application server.

Check this link for a more detailed explanation of how this is not an application server problem.

http://blogs.oracle.com/fkieviet/entry/classloader_leaks_the_dreaded_java

0
source share

All Articles