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


- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01