While learning about java memory profiling, I keep seeing the term \"perm space\" in addition to \"heap.\" I know what the heap is - what\'s perm space?
PermGen Space stands for memory allocation for Permanent generation All Java immutable objects come under this category, like String
which is created with literals or with String.intern()
methods and for loading the classes into memory. PermGen Space speeds up our String equality searching.
What exists under PremGen : Class Area comes under PremGen area. Static fields are also developed at class loading time, so they also exist in PremGen. Constant Pool area having all immutable fields that are pooled like String are kept here. In addition to that, class data loaded by class loaders, Object arrays, internal objects used by jvm are also located.
Simple (and oversimplified) answer: it's where the jvm stores its own bookkeeping data, as opposed to your data.
It stands for permanent generation:
The permanent generation is special because it holds meta-data describing user classes (classes that are not part of the Java language). Examples of such meta-data are objects describing classes and methods and they are stored in the Permanent Generation. Applications with large code-base can quickly fill up this segment of the heap which will cause
java.lang.OutOfMemoryError
: PermGen no matter how high your -Xmx and how much memory you have on the machine.