当前位置:网站首页>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 .
边栏推荐
- 只是巧合?苹果 iOS16 的神秘技术竟然与中国企业 5 年前产品一致!
- Read and understand the rendering mechanism and principle of flutter's three trees
- 多表操作-自关联查询
- Multi table operation - sub query
- vscode快捷键
- 2022年国内云管平台厂商哪家好?为什么?
- Check the debug port information in rancher and do idea remote JVM debug
- 【PyTorch预训练模型修改、增删特定层】
- Principle and performance analysis of lepton lossless compression
- 【pytorch 修改预训练模型:实测加载预训练模型与模型随机初始化差别不大】
猜你喜欢
![[singleshotmultiboxdetector (SSD, single step multi frame target detection)]](/img/c7/8ad64582e09683818171b625769f37.png)
[singleshotmultiboxdetector (SSD, single step multi frame target detection)]

One article tells the latest and complete learning materials of flutter

Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises

July Huaqing learning-1

What is digital existence? Digital transformation starts with digital existence
The survey shows that traditional data security tools cannot resist blackmail software attacks in 60% of cases

强化学习-学习笔记3 | 策略学习
![[yolov3 loss function]](/img/79/87bcc408758403cf3993acc015381a.png)
[yolov3 loss function]
Why do you always fail in automated tests?
![[deploy pytoch project through onnx using tensorrt]](/img/b6/ec95f028f749753666c7877134ad70.png)
[deploy pytoch project through onnx using tensorrt]
随机推荐
Video networkstate property
MySQL multi table operation
What is digital existence? Digital transformation starts with digital existence
Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises
MySQL index - extended data
【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
【load dataset】
A guide to threaded and asynchronous UI development in the "quick start fluent Development Series tutorials"
语义分割实验:Unet网络/MSRC2数据集
Tabbar configuration at the bottom of wechat applet
mmclassification 训练自定义数据
Principle of redis cluster mode
[deploy pytoch project through onnx using tensorrt]
Yolov5 target detection neural network -- calculation principle of loss function
Open3d mesh (surface) coloring
Four operations and derivative operations of MATLAB polynomials
Design of music box based on assembly language
投资理财适合女生吗?女生可以买哪些理财产品?
什么是数字化存在?数字化转型要先从数字化存在开始
One article tells the latest and complete learning materials of flutter