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

CMS问题 #25

Open
renjie-rm opened this issue Apr 26, 2022 · 7 comments
Open

CMS问题 #25

renjie-rm opened this issue Apr 26, 2022 · 7 comments

Comments

@renjie-rm
Copy link

大佬,请问CMS 标记阶段为什么会需要STW?

@lkun
Copy link

lkun commented Apr 26, 2022 via email

@haimli
Copy link

haimli commented Apr 26, 2022 via email

@MengXiangDing
Copy link

我的理解,初始标记的时候,是根据GC ROOT进行可达性查询,如果不STW的话,GC ROOT会有变动;重新标记的时候,是为了标记那些在并发标记漏掉的对象,所以这里的标记时长不会很久,所以需要STW。感觉重新标记的STW解释有点牵强,欢迎大佬一起讨论。

@renjie-rm
Copy link
Author

看有的博客写的cms采用三色标记法,最开始为白色,标记完成之后白色的即为垃圾,那么增量的数据在并发清除阶段如何处理?
感觉不stw好像也没啥问题。

@MengXiangDing
Copy link

这个我也不知道啦。不过说实话,国内的博客一个抄一个没啥看的,这个博客写的也是比较浅显易懂,还是看周志明老师的书比较好。

@renjie-rm
Copy link
Author

好吧,希望能找到答案!

@HiFxs
Copy link

HiFxs commented Apr 28, 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

5 participants