Friends,
Can you please give me significance, difference and uses for Heap and PermGen. Also it would be good to know what class are loaded in them respectively.
Explanation related to Java VM specification would be really helpful
Thanks Punith
PermGen stands for Permanent Generation. It is a special type of heap space. It is separate from the main memory (heap). JVM uses PermGen to keep track of loaded class metadata.
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.
Memory(Heap) is managed in generations, or memory pools holding objects of different ages. Garbage collection occurs in each generation when the generation fills up. Objects are allocated in a generation for younger objects or the young generation
, and because of infant mortality most objects die there.
When any new object is constructed it goes to Eden space which is a part of Young Generation
.
If object is still alive after some time it goes to tenured generation
where long lived objects lie.
If object is supposed to live until over process exist then object is moved to Perm Generation
.Java classes
are stored in the permanent generation.
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