当前位置:网站首页>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 .
边栏推荐
- MySQL multi table operation
- Vscode shortcut key
- Matlab label2idx function (convert the label matrix into a cell array with linear index)
- Embedded software architecture design - message interaction
- Network five whip
- How can beginners learn flutter efficiently?
- MySQL constraints
- 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
- Matlab imoverlay function (burn binary mask into two-dimensional image)
- Application of a class of identities (vandermond convolution and hypergeometric functions)
猜你喜欢
Linux Installation and deployment lamp (apache+mysql+php)
Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises
Redis cluster (master-slave) brain crack and solution
Pytorch MLP
1 plug-in to handle advertisements in web pages
[mainstream nivida graphics card deep learning / reinforcement learning /ai computing power summary]
7月华清学习-1
How can beginners learn flutter efficiently?
查看rancher中debug端口信息,并做IDEA Remote Jvm Debug
Network five whip
随机推荐
互联网公司实习岗位选择与简易版职业发展规划
MySQL trigger
Codeworks 5 questions per day (1700 average) - day 5
Matlab imoverlay function (burn binary mask into two-dimensional image)
HiEngine:可媲美本地的云原生内存数据库引擎
Embedded software architecture design - message interaction
你做自动化测试为什么总是失败?
Pytorch weight decay and dropout
[deploy pytoch project through onnx using tensorrt]
【主流Nivida显卡深度学习/强化学习/AI算力汇总】
Error modulenotfounderror: no module named 'cv2 aruco‘
One article tells the latest and complete learning materials of flutter
abap查表程序
Troubleshooting of high memory usage of redis in a production environment
SENT协议译码的深入探讨
[pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]
Semantic segmentation experiment: UNET network /msrc2 dataset
Hiengine: comparable to the local cloud native memory database engine
Seven ways to achieve vertical centering
Riddle 1