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

v8 垃圾回收 #31

Open
Yuanfang-fe opened this issue Jun 2, 2021 · 0 comments
Open

v8 垃圾回收 #31

Yuanfang-fe opened this issue Jun 2, 2021 · 0 comments

Comments

@Yuanfang-fe
Copy link
Owner

Yuanfang-fe commented Jun 2, 2021

to do,闲了再仔细研究整理下

原始数据类型放在栈中
引用数据类型放在堆中
还没搞懂为啥这么放?

简单罗列下关键点:
新生代:Scavenger算法 + 副垃圾回收器 minor GC + 活动区+空闲区循环交替(标记活动对象,复制活动对象的时候顺便碎片整理) 1-8MB(又有说64位系统是64MB,32位减半)、第二轮标记晋升到老生代、空间满了就进行清理

老生代:主垃圾回收器 major GC (64位系统是1.4GB,32位减半)
增量垃圾回收:间歇少量多次回收,避免卡住主线程
Mark-Sweep、Mark-Compact

参考:
https://juejin.cn/post/6844903769495306247
https://my.oschina.net/u/4581139/blog/4834407
https://zhuanlan.zhihu.com/p/146749402

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

1 participant