In the JVM, PermGen holds the metadata about classes that have been loaded/created. This information is garbage collected like the other parts of the heap, however there are rough edges that can prevent this from happening, class loaders in particular.
PermGen is not a part of the region called heap.Actually, in Sun's JVM Permanent Generation (PermGen) is completely separate from the heap.
This area is filled of your app classes metadata and many other things that do not depend on the application usage.
For the HotSpot Java VM, the memory pools for serial garbage collection are the following.
Eden Space (heap): The pool from which memory is initially allocated for most objects.
Survivor Space (heap): The pool containing objects that have survived the garbage collection of the Eden space.
Tenured Generation (heap): The pool containing objects that have existed for some time in the survivor space.
Permanent Generation (non-heap): The pool containing all the reflective data of the virtual machine itself, such as class and method objects. With Java VMs that use class data sharing, this generation is divided into read-only and read-write areas.
Code Cache (non-heap): The HotSpot Java VM also includes a code cache, containing memory that is used for compilation and storage of native code.
Some of the common causes:
Custom classloaders that don't carefully free up older classes after loading new ones.
Classes remaining in PermGen after redeploying an application multiple times (more common in Dev than Prod)
Heavy use of Proxy classes, which are created synthetically during runtime. It's easy to create new Proxy classes when an a single class definition could be reused for multiple instances.
Exception in thread main java.lang.OutOfMemoryError: PermGen space signifies too many classes loaded or being generated; or the String.intern table is too big. Increase using the -XX:MaxPermSize option.
-XX:PermSize=256M -XX:MaxPermSize=128M
How do I know what classes are being loaded or unloaded? Use the command line options
-XX:+TraceClassloading and -XX:+TraceClassUnloading http://java.sun.com/docs/hotspot/gc1.4.2/faq.html
http://stackoverflow.com/questions/2051734/why-is-permgen-space-growing
http://download.oracle.com/javase/1.4.2/docs/tooldocs/windows/java.html
Subscribe to:
Post Comments (Atom)
1 comments:
Another option to use in vm arguments is as follows:
"-verbose:class"
Post a Comment