Update java-basic-questions-01.md#2882
Open
JasonZhangZx wants to merge 1 commit into
Open
Conversation
静态成员变量在方法区(元空间),下文还有2个插图也描述的是堆
daltino
approved these changes
Jul 12, 2026
daltino
left a comment
There was a problem hiding this comment.
The change clarifies an important distinction regarding the location of static variables in memory, correcting the explanation for versions after JDK 1.7 by specifying the "method area" instead of the heap. This update improves the technical accuracy of the documentation.
Snailclimb
requested changes
Jul 19, 2026
Snailclimb
left a comment
Owner
There was a problem hiding this comment.
感谢修正这段说明,不过当前替换后的表述仍不准确,麻烦再调整后提交:
- HotSpot 的永久代是在 JDK 8 才移除,而不是 JDK 1.7;
- OpenJDK 的 JEP 122 说明,移除永久代后,类静态变量移至 Java 堆,类元数据移至本地内存;
- “方法区”是 JVM 规范中的逻辑运行时区域,不能直接替代这里关于 HotSpot 实现存储位置的描述。
建议将这一小节整体改为区分“JVM 规范的逻辑概念”和“HotSpot 在不同 JDK 版本的实现”,并一并核对 PR 描述中提到的两张插图。参考:https://openjdk.org/jeps/122
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
静态成员变量在方法区(元空间),下文还有2个插图也描述的是堆