方法区域和PermGen [英] Method Area and PermGen

查看:110
本文介绍了方法区域和PermGen的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图理解HotSpot JVM的内存结构,并且混淆了两个术语'Method Area'和'PermGen'空间。我提到的文档说,Method Area包含类和方法的定义,包括字节代码。其他一些文档说它们存储在PermGen空间中。

I was trying to understand the memory structure of HotSpot JVM and got confused with the two terms 'Method Area' and 'PermGen' space. The docs I referred say that Method Area contains the definition of classes and methods including the byte code. Some other docs say that they are stored in the PermGen space.

那么我可以断定这两个存储区是一样的吗?

So can I conclude that these two memory areas are same?

推荐答案

您应该查看 Java内存类型,并可选择在这篇关于Java中垃圾收集的文档。后者非常冗长,都很有用。

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.

实际上,Method区域是Permanent Generation的一部分:

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

与终身代密切相关的第三代是
永久代。永久生成是特殊的,因为
保存了虚拟机所需的数据,用于描述在Java语言级别上没有等价的
的对象。例如,描述类和方法的
对象存储在永久
代中。

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.

这篇关于方法区域和PermGen的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆