当前位置:网站首页>Main stages of garbage collection in ZGC
Main stages of garbage collection in ZGC
2022-06-12 21:17:00 【lixia0417mul2】
zgc At present, it is collected by the whole heap , There are no generations , So it's saved Rset Memory consumption of cross generational record references ,zgc The whole gc The process is mainly divided into the following stages :
1. Initial identification (stw): Identify the root object in the heap , The root object mainly includes the thread stack , Global variables, etc
2. Concurrent identification : Starting from the root of the first stage , Concurrency identifies other objects reachable from the root object , Run concurrently with the application , The identification algorithm uses the three color method to mark objects , See the previous article for the principle of three color method to identify objects
3. Re identify (stw): This phase is mainly to re identify the missing identification of objects caused by the concurrent running of threads in the parallel phase .
4. Non strong root reference processing : Processing at this stage Finalizer quote , Virtual reference , Objects such as weak references and ghost references
5. Reset transfer set + Recycle invalid pages : Because of the last round of zgc in , Some objects have been moved to new pages , But the address actually referenced in the object is still the old address ( Because after the last round of object migration , These objects have never been accessed , The read barrier has not been triggered to change to a new address 【 However, the number of such objects should not be large 】), After the previous identification phase , The actual reference address of these objects has been changed to the new address , In this way, the transfer table can be reset safely ( Because the values referenced by all objects are new address values ), After resetting the transfer table , Because the transfer table is on the old page , At this time, you can also recycle the old pages by the way
6. Select the page to be recycled ( step 1) : This stage will recycle those pages that are full of garbage objects , Note that this stage is in zgc Is executed concurrently , Corresponding to g1 Initial cleanup Stage , however g1 Initial cleanup Stage is stw Of , Do more than this zgc At this stage of , such as g1 Initial cleanup Stage + Concurrent cleanup also sorts pages according to the amount of garbage on the page , For the subsequent mixed gc Make a plan
7. Select the page to be recycled ( step 2): This stage will sort according to the proportion of garbage size in each page , And select those whose garbage proportion is greater than the threshold ( Configurable ZFramentLimit) The page of enters the garbage collection candidate set
8. Initial transfer stw: This phase will shift root Object to the new page address , Corresponding to G1 in evacuation Part of the stage , But with the g1 evacuation The whole stage is stw Different ,zgc Only the initial transfer root Stage is stw Of
9. Concurrent transfers :zgc Transfer the remaining non root Objects are executed concurrently with the application , This stage corresponds to G1 Medium Evacuation pause Stage (ygc perhaps mixed gc Transfer phase of ), Be careful g1 Medium Evacuation Stage is stw Of
边栏推荐
- atoi超强解析
- test
- China hydraulic press market trend report, technical innovation and market forecast
- ASCII code comparison table
- Teambition 协作应用心得分享|社区征文
- 实现从字符串中删除某个字符操作
- Pytorch how to set random number seed to make the result repeatable
- Data visualization - Calendar chart
- #141 Linked List Cycle
- JSON file handles object Tags
猜你喜欢

#141 Linked List Cycle

Listener in JSP

Library cache lock brought by add trandata

Sorting out the knowledge points of primary and secondary indicators

测试基础之:单元测试

Lake shore PT-100 platinum resistance temperature sensor

风控建模十:传统建模方法存在的问题探讨及改进方法探索

My way of programming

Data visualization - broken line area chart

ASCII 码对照表
随机推荐
Draw according to weight
Research Report on hydraulic injection machine industry - market status analysis and development prospect forecast
In the spring recruitment of 2022, the test engineer will have a full set of interview strategies to thoroughly understand all the technical stacks (all dry goods)
同花顺能开户吗,在APP上可以直接开通券商安全吗
Large and small end conversion
ASCII code comparison table
递归调用知识点-包含例题求解二分查找、青蛙跳台阶、逆序输出、阶乘、斐波那契、汉诺塔。
Troubleshooting of service port failure
My way of programming
Insert sort
HR SaaS unicorn is about to emerge. Will the employee experience be the next explosive point?
Select sort
函数的了解
二分查找
Understanding of closures
Introduction to scala basic grammar (III) various operators in Scala
Structure knowledge points all in
Market trend report, technical innovation and market forecast of hydraulic torque wrench in China
Listener in JSP
GPU giant NVIDIA suffered a "devastating" network attack, and the number one malware shut down its botnet infrastructure | global network security hotspot on February 28