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

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

问题描述

我试图了解 HotSpot JVM 的内存结构,但对 方法区"PermGen" 空间这两个术语感到困惑.我提到的文档说方法区包含类和方法的定义,包括字节码.其他一些文档说它们存储在 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 to 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 内存类型 以及关于 垃圾收集.后者非常冗长,两者都很有用.

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天全站免登陆