What is PermGen-space in Java? Our team has issues with PermGen-space getting increased. This increase affects performance in the end.
I wanted to know about what PermGen-space is and how can we optimize its space usage?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From http://java.sun.com/docs/hotspot/gc1.4.2/faq.html (Questions 7–10)
How should the permanent generation be sized?
The permanent generation is used to hold reflective of the VM itself such as class objects and method objects. These reflective objects are allocated directly into the permanent generation, and it is sized independently from the other generations. Generally, sizing of this generation can be ignored because the default size is adequate. However, programs that load many classes may need a larger permanent generation.
How can I tell if the permanent generation is filling up?
Starting in 1.4.2 -XX:+PrintGCDetails will print information about all parts of the heap collected at each garbage collection. For a full collection
[Full GC [Tenured: 30437K->33739K(280576K), 0.7050569 secs] 106231K->33739K(362112K), [Perm : 2919K->2919K(16384K)], 0.7052334 secs]
this example shows that little was collected in the permanent generation (it went from 2919K used before the collection to 2919K used after the collection) and the current size of the permanent generation is 16384K.
How can I increase the permanent generation size?
Use the command line option -XX:MaxPermSize=
How do I know what classes are being loaded or unloaded?
Use the command line options -XX:+TraceClassloading and -XX:+TraceClassUnloading