当前位置:网站首页>Learn the garbage collector of JVM -- a brief introduction to Shenandoah collector
Learn the garbage collector of JVM -- a brief introduction to Shenandoah collector
2022-07-05 12:15:00 【The king of early rising】
There are mainly two low latency garbage collectors :
Shenandoah The collector and Officially launched ZGC The collector
Shenandoah
Brief introduction
- Support concurrent collation algorithm
- Default generation free
- Use a global data structure called a connection matrix to record cross Region Reference relation of .
There are no generations , It is out of consideration of cost performance .
The connection matrix can be regarded as a two-dimensional table , If Region n There is an object pointing to Region m, It's on the form n That's ok m Put a mark in the column . Judge by such a mark Region Reference relationship between .
working process
1. Initial marker : And G1 equally , First mark with GC Roots Directly associated objects , This stage is still yes “Stop The World” Of , But the pause time has nothing to do with the heap size , Only with GC Roots The quantity is related to .
2. Concurrent Tags : And G1 equally , Traversal object graph , Mark all accessible objects , This stage is together with the user thread Concurrent Of , The length of time depends on the number of surviving objects in the heap and the structural complexity of the object graph .
3. Final marker : And G1 equally , Deal with the rest SATB scanning , And at this stage, it is calculated that the recycling value is the highest Region, Will these Region Make up a collection . There will also be a short pause in the final marking phase .
4. Concurrent cleanup : This stage is used to clean up those objects that have not been found in the whole area Region.
5. Concurrent recovery : The concurrent recycle phase is Shenandoah Prior to HotSpot The core differences of other collectors in . At this stage ,Shenandoah You need to make a copy of the living object back in the collection to the unused one Region In . The duration of the concurrent recycle phase depends on the size of the recycle set .
6. Initial reference update : After copying objects in the concurrent recycle phase , You also need to fix all references to old objects in the heap to new addresses after copying , This operation is called reference update . The initialization phase of the reference update doesn't actually do anything specific , This phase is only set up to create a thread collection point , Ensure that all concurrent recovery phases are in progress All collector threads have completed the object movement task assigned to them . There will be a very short pause .
7. Concurrent reference updates : Actually start the reference update operation , This phase is concurrent with the user thread , The length of time depends on the number of references involved in memory . Concurrent reference updates are different from concurrent tags , it No longer need to search along the object graph , Just follow the memory physical address order , Search for reference types linearly , Change the old value to the new value .
8. Final quote update : After resolving the reference update in the heap , And fix the existing GC Roots Citation in . This stage is Shenandoah The last pause of , The pause time is only with GC Roots The quantity is related to .
9. Concurrent cleanup : After concurrent recycling and reference updates , The whole collection of all Region There are no more living objects , Finally, call the concurrent cleanup process again to recycle these Region Of memory space , For later allocation of new objects .
边栏推荐
- HiEngine:可媲美本地的云原生内存数据库引擎
- MySQL storage engine
- [loss functions of L1, L2 and smooth L1]
- JS for循环 循环次数异常
- Understanding the architecture type of mobile CPU
- Deep discussion on the decoding of sent protocol
- MySQL installation, Windows version
- The evolution of mobile cross platform technology
- Reading notes of growth hacker
- 【主流Nivida显卡深度学习/强化学习/AI算力汇总】
猜你喜欢
Multi table operation - Auto Association query
强化学习-学习笔记3 | 策略学习
HiEngine:可媲美本地的云原生内存数据库引擎
Multi table operation - sub query
July Huaqing learning-1
Reading notes of growth hacker
Codeworks 5 questions per day (1700 average) - day 5
Redis cluster (master-slave) brain crack and solution
Automated test lifecycle
互联网公司实习岗位选择与简易版职业发展规划
随机推荐
Matlab label2idx function (convert the label matrix into a cell array with linear index)
HiEngine:可媲美本地的云原生内存数据库引擎
[mainstream nivida graphics card deep learning / reinforcement learning /ai computing power summary]
MySQL splits strings for conditional queries
Hiengine: comparable to the local cloud native memory database engine
Flutter2 heavy release supports web and desktop applications
Network five whip
MySQL trigger
Principle of redis cluster mode
跨平台(32bit和64bit)的 printf 格式符 %lld 输出64位的解决方式
手机 CPU 架构类型了解
II. Data type
How to clear floating?
[configuration method of win11 multi-user simultaneous login remote desktop]
byte2String、string2Byte
The most comprehensive new database in the whole network, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, flying Book Multidimensional table, heipayun, Zhix
Which domestic cloud management platform manufacturer is good in 2022? Why?
Reinforcement learning - learning notes 3 | strategic learning
Intern position selection and simplified career development planning in Internet companies
Conversion du format de données GPS [facile à comprendre]