Method Area and PermGen(方法区和 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:方法区和 PermGen
基础教程推荐
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 降序排序:Java Map 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01