Is permanent generation part of the heap or does it lies in a different space of itself in jvm

前端 未结 5 439
挽巷
挽巷 2021-01-02 14:39

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 wher

5条回答
  •  天命终不由人
    2021-01-02 14:54

    Here is my understanding of the topic:

    The permanent generation is the region of the heap where class definitions are stored. As shown at http://blogs.oracle.com/jonthecollector/entry/presenting_the_permanent_generation, all class instances have a 'klass' reference to an instance of their type's class in the permanent generation. When new types are created at runtime, new space is allocated in the permanent generation for their types.

    The diagram on Jon Masamitsu's blog post shows the logical separation between the permanent generation and the more-frequently-collected parts of the heap where your program's object instances can be stored. The permanent generation is still part of the heap.

提交回复
热议问题