Method Area and PermGen

前端 未结 4 576
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-13 14:45

I was trying to understand the memory structure of HotSpot JVM and got confused with the two terms \"Method Area\" and \"PermGen\" space. T

相关标签:
4条回答
  • 2020-12-13 15:20

    gives a pretty good idea which I haven't found elsewhere

    Most people talk about Heap and Stack as equivalents, and as the main components, but Tai gives a picture-perfect explanation with superb images.

    Edit: Link no longer works :(

    0 讨论(0)
  • 2020-12-13 15:26

    You should take a look at Java Memory Types and optionally at this doc about the Garbage Collection in Java. The latter is very verbose and both are useful.

    Actually the Method area is a part of the Permanent Generation:

    A third generation closely related to the tenured generation is the permanent generation. The permanent generation is special because it holds data needed by the virtual machine to describe objects that do not have an equivalence at the Java language level. For example objects describing classes and methods are stored in the permanent generation.

    0 讨论(0)
  • 2020-12-13 15:37

    Method Area is basically a non heap space like Stack which keeps class skeleton. skeleton includes static variables with values, constructors etc. The reflection operation are operated on this memory area. Perm is a memory space parallel to heap with keeps the binary code of current executing class.

    0 讨论(0)
  • 2020-12-13 15:42

    You could consider the "Method Area" a subset of "PermGen", as the permanent generation space does hold class defintions, but it also holds interned Strings and other bits of data unlikely to ever be discarded,

    0 讨论(0)
提交回复
热议问题