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

动态对象年龄判定这里的描述是有问题! #32

Open
shenliuming opened this issue Jun 16, 2022 · 5 comments
Open

动态对象年龄判定这里的描述是有问题! #32

shenliuming opened this issue Jun 16, 2022 · 5 comments

Comments

@shenliuming
Copy link

周志明老师的描述:
如果当前新生代的 Survivor 中,相同年龄所有对象大小的总和大于 Survivor 空间的一半,年龄 >= 该年龄的对象就可以直接进入老年代,无须等到 MaxTenuringThreshold 中要求的年龄。
实际上,经过测试的结论:
如果当前新生代的Survivor中,年龄小到大(1,2,3,4,5,N)的对象所有对象的大小总和大于Survivor空间的一半,年龄N >=该年龄的对象就可以直接晋升到老年代,无须等到MaxTenuringThreshold中要求的年龄。

@shenliuming
Copy link
Author

这里的动态年龄判定,指的就是年龄N的动态,不是指相同年龄的所有对象,目的都是为了减少GC。

@yanglbme
Copy link
Member

= 该年龄的对象就可以直接进入老年代,无须等到 MaxTenuringThreshold 中要求的年龄。
实际上,经过测试的结论:
如果当前新生代的Survivor中,年龄小到大(1,2,3,4,5,N)的对象所有对象的大小总和大于Survivor空间的一半,年龄N >=该年龄的对象就可以直接晋升到老年代,无须等到MaxTenuringThreshold中要求的年龄。

那你这里的“年龄N >=该年龄的对象就可以直接晋升到老年代”,“该年龄”指的是哪个年龄?

@shenliuming
Copy link
Author

shenliuming commented Jun 18, 2022 via email

@lkun
Copy link

lkun commented Oct 11, 2022 via email

@haimli
Copy link

haimli commented Oct 11, 2022 via email

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

No branches or pull requests

4 participants