Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于动态对象年龄判定描述不准确 #1199

Closed
1725636955 opened this issue May 19, 2021 · 2 comments
Closed

关于动态对象年龄判定描述不准确 #1199

1725636955 opened this issue May 19, 2021 · 2 comments
Labels
bug Content error

Comments

@1725636955
Copy link
Contributor

1725636955 commented May 19, 2021

现有描述:Hotspot 遍历所有对象时,按照年龄从小到大对其所占用的大小进行累积,当累积的某个年龄大小超过了 survivor 区的一半时,取这个年龄和 MaxTenuringThreshold 中更小的一个值,作为新的晋升年龄阈值

不准确的地方:超过survivor区一半时。这个一半并不是硬编码到代码中的(默认值是50%),而是可以通过jvm启动参数设置
参数为:-XX:TargetSurvivorRatio=percent。总结就是年龄从小到大进行累加,当加入某个年龄段后,累加和超过survivor区域*TargetSurvivorRatio的时候,就从大于这个年龄段的年龄的对象进行晋升

jdk8官方文档引用:https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html
博客参考:https://www.jianshu.com/p/989d3b06a49d

本项目文章地址:https://snailclimb.gitee.io/javaguide/#/docs/java/jvm/JVM%E5%9E%83%E5%9C%BE%E5%9B%9E%E6%94%B6?id=_14-%e5%8a%a8%e6%80%81%e5%af%b9%e8%b1%a1%e5%b9%b4%e9%be%84%e5%88%a4%e5%ae%9a
image
image

@Snailclimb
Copy link
Owner

jdk8官方文档引用:https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html

image

赞👍 已经修改~

@Snailclimb Snailclimb added the bug Content error label May 31, 2021
@eazydripz
Copy link

❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Content error
Projects
None yet
Development

No branches or pull requests

3 participants