Significance of PermGen Space

java_geek picture java_geek · Feb 10, 2010 · Viewed 11.7k times · Source

What is the significance of PermGen space in java?

Answer

danben picture danben · Feb 10, 2010

PermGen space is reserved for long-term objects - mostly Class objects loaded by the ClassLoader. PermGen will not be garbage collected except under very special circumstances (specifically, when the ClassLoader that loaded those classes goes out of scope).

This is a garbage collection optimization - if objects that we don't expect to be garbage collected are stored separately, it compacts the space where the rest of the objects are stored, which leads to less work for the garbage collector.