Method Area and PermGen

依然范特西╮ 提交于 2019-11-28 19:32:38

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.

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,

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.

http://www.pointsoftware.ch/en/under-the-hood-runtime-data-areas-javas-memory-model/ gives a pretty good idea which I havent 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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!