I have seen multiple comments regarding this question - some say yes and some say no, and many of the answers are ambiguous. Can anyone please describe in simpler terms where it resides? In one post I even saw someone say that it shares the same memory place as class memory where classes are loaded into by classloaders - is that true?
Original (perhaps mistaken) answer: If wikipedia is to be believed, it's part of the heap.
Edit: I've looked around at this more, including the site referenced in a comment by the OP. During this research I came across this SO question, which references this document, which indicates that for Sun Java (version 6), the permanent collection is actually outside the heap. That said, I'm no Java expert and wasn't previously aware of the memory management details at this level. If my reading is correct, the placement - or even the existence - of the permanent generation is a jvm implementation detail.
From a blackbox perspective, in Sun JVMs, Permanent Generation is not part of the heap as stated in jconsole
's documentation:
Permanent Generation (non-heap): The pool containing all the reflective data of the virtual machine itself, such as class and method objects. With Java VMs that use class data sharing, this generation is divided into read-only and read-write areas.
In practice, this means that your -XX:MaxPermSize
memory adds up to your -Xmx
memory in the JVM process, as permanent generation is not included in the heap.
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