当前位置:网站首页>zgc 并发标识和并发转移阶段的多视图地址映射
zgc 并发标识和并发转移阶段的多视图地址映射
2022-06-12 21:17:00 【lixia0417mul2】
M0,M1,Remapped三种多视图地址映射是zgc能够实现并发标识和并发转移的关键前提,这三种地址其实都对应到同一个物理地址,对应的是同一个底层的对象,大体上zgc过程中的地址映射变换关系如下:
第一轮的zgc:
1.初始标识阶段
初始标识阶段对象的地址视图都是Remapped
2.并发标识阶段
存活对象的地址从Remapped地址变成M0地址,非存活对象的地址依然保持为Remapped映射阶段,这个阶段中新分配对象的地址视图是M0
3.并发转移阶段
存活对象(地址视图是M0)被转移到新的地址空间并重新标识为Remapped地址视图,非存活对象(地址视图是Remapped)会被垃圾回收,这个阶段中新分配的对象的地址视图为Remapped
第二轮的zgc:
1.初始标识阶段
初始标识阶段对象的地址视图都是Remapped,或者M0,M0地址视图的原因是有些对象在上一轮并发转移阶段中没有被转移也没有被访问,所以依然保持上一轮并发标识结束后的M0视图.–这里引申出另一层含义,在一轮的zgc中,虽然是对整堆空间进行标记的,但是并不是所有标记的存活对象都被转移,也不是所有的垃圾对象都被回收,对于那些垃圾占比比较小的页面,在一轮的zgc中这些页面中的存活对象不会被转移,垃圾对象也不会被回收.
2.并发标识阶段
存活对象的地址从Remapped/M0地址变成M1地址,非存活对象的地址依然保持为Remapped/M0映射阶段,这个阶段中新分配对象的地址视图是M1
3.并发转移阶段
存活对象(地址视图是M1)被转移到新的地址空间并重新标识为Remapped地址视图,非存活对象(地址视图是Remapped或者M0)会被垃圾回收,这个阶段中新分配的对象的地址视图为Remapped
后面的多轮zgc中,并发标识的对象视图就会在M0和M1中交替轮流使用
此外zgc中多视图映射速度很快,每次从Remapped标识成M0或者M1只需要修改对象地址中的第42位到第45位的值就可以完成地址映射操作,而cms或者g1中标记对象需要访问对象地址所指向的具体对象的对象头,并把对象头中的标志位进行标记,这个过程中涉及访问对象内存,而zgc无需访问对象内存,这也是zgc比较快的原因.
边栏推荐
- New product release Junda intelligent integrated environmental monitoring terminal
- Is it really possible to find a testing job with a monthly income of more than 10000 without a degree and self-study software testing?
- Research Report on market supply and demand and strategy of China's hydraulic hammer industry
- leetcode:210. Schedule II
- At the same time, do the test. Others have been paid 20W a year. Why are you still working hard to reach 10K a month?
- Scatter in pytorch_ () function
- 对闭包的理解
- 循环插入excel某一列,以及多列之和
- 字符串基础知识
- CUDA out of memory
猜你喜欢

Is it really possible to find a testing job with a monthly income of more than 10000 without a degree and self-study software testing?

leetcode:207. Class Schedule Card

At the same time, do the test. Others have been paid 20W a year. Why are you still working hard to reach 10K a month?

Scope and scope chain

Junda technology is applicable to "kestar" intelligent precision air conditioning network monitoring

测试基础之:单元测试

Teamwork collaboration application experience sharing | community essay solicitation

Data visualization - histogram

Solve the cvxpy error the solver GLPK_ MI is not installed

#113 Path Sum II
随机推荐
Teamwork collaboration application experience sharing | community essay solicitation
Compréhension préliminaire des expressions régulières cognitives (regex)
Allegro Xile technology, a developer of distributed cloud services, received millions of dollars of angel round financing and was independently invested by Yaotu capital
JSON file handles object Tags
二分查找
Data visualization - Calendar chart
风控建模十:传统建模方法存在的问题探讨及改进方法探索
shell语言
It has been engaged in the functional test of 10K to the test development of 40W annual salary for 5 years, and spent 7 days sorting out the super comprehensive learning route
USB mechanical keyboard changed to Bluetooth Keyboard
torch. nn. Linear() function
To delete a character from a string
leetcode:210. Schedule II
Can flush open an account? Can you directly open the security of securities companies on the app? How to open an account online when buying stocks
What's a good gift for the goddess Festival? Gift recommendation for the goddess Festival on March 8
Is it really possible to find a testing job with a monthly income of more than 10000 without a degree and self-study software testing?
同花顺能开户吗,同花顺在APP上可以直接开通券商安全吗 ,买股票怎么网上开户
Structure knowledge points all in
test
Algorinote_ 2_ Main theorem and Akra bazzi theorem