What is the significance of PermGen space in java?
The PermGen area of the Java heap is used to store metadata such as class declarations, methods and object arrays. Therefore, the PermGen size requirements depend on the number of classes and methods as well as their size. Java memory is separated into different regions - Young, Tenured and PermGen.
PermGen (Permanent Generation) is a special heap space separated from the main memory heap. The JVM keeps track of loaded class metadata in the PermGen. Additionally, the JVM stores all the static content in this memory section.
Advantages of MetaSpace Take advantage of Java Specification property: Classes and associated metadata lifetimes match class loaders. Per loader storage area: Metaspace. Linear allocation only. No individual reclamation (except for Redefine Classes and class loading failure)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With