当前位置:网站首页>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
边栏推荐
- Cv2.lut() (populates the output array with values from the lookup table)
- EU officially released the data act, Ukraine was attacked by DDoS again, kitchen appliance giant Meiya was attacked, internal data leakage network security weekly
- Inrelease: the following signature cannot be verified because there is no public key: no_ PUBKEY EB3E94ADBE1229CF
- Research Report on hydraulic solenoid valve industry - market status analysis and development prospect forecast
- #113 Path Sum II
- 指针与数组&指针与const&结构体与const
- [tutorial] Firefox send: deployment method of Firefox open source temporary file sharing service platform
- Is it safe to open an account in flush? How to open an account online to buy stocks
- Select sort
- 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
猜你喜欢
Composer version degradation
Listener in JSP
Lake shore PT-100 platinum resistance temperature sensor
Summary of machine learning materials
结构体知识点all in
Solve the cvxpy error the solver GLPK_ MI is not installed
ASCII 码对照表
How do testers plan for their future? To achieve 25K in 2 years?
Distributed cloud service developer'allegro Xile technology 'received an angel round financing of US $3million
What's a good gift for the goddess Festival? Gift recommendation for the goddess Festival on March 8
随机推荐
新品发布丨竣达智能综合环境监测终端
Structure knowledge points all in
leetcode:210. Schedule II
Introduction to the characteristics of balancer decentralized exchange market capitalization robot
atoi超强解析
What did new do
Typescript definition type: type 'timeout' cannot be assigned to type 'number';
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?
Troubleshooting of service port failure
ATOI super resolution
A blog written clearly by vit
Do we media video, and share the necessary app for friendly new media operation
Social metauniverse: start from redefining yourself
My way of programming
大小端转换
shell语言
Listener in JSP
Before job hopping, Jin San made up the interview questions. Jin San successfully landed at Tencent and got a 30K test offer
作用域和作用域链
String Basics