当前位置:网站首页>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 index - extended data
- 【主流Nivida显卡深度学习/强化学习/AI算力汇总】
- JS for循环 循环次数异常
- Hash tag usage in redis cluster
- 【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
- [HDU 2096] 小明A+B
- Select drop-down box realizes three-level linkage of provinces and cities in China
- Tabbar configuration at the bottom of wechat applet
猜你喜欢
Master the new features of fluent 2.10
Hiengine: comparable to the local cloud native memory database engine
[pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]
HiEngine:可媲美本地的云原生内存数据库引擎
Why do you always fail in automated tests?
【TFLite, ONNX, CoreML, TensorRT Export】
Seven ways to achieve vertical centering
Matlab label2idx function (convert the label matrix into a cell array with linear index)
Splunk configuration 163 mailbox alarm
什么是数字化存在?数字化转型要先从数字化存在开始
随机推荐
Time tools
How can beginners learn flutter efficiently?
[yolov5.yaml parsing]
Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises
Codeworks 5 questions per day (1700 average) - day 5
Halcon 模板匹配实战代码(一)
MySQL regular expression
Understanding the architecture type of mobile CPU
Codeforces Round #804 (Div. 2)
[upsampling method opencv interpolation]
【load dataset】
vscode快捷键
GPS data format conversion [easy to understand]
Pytorch linear regression
Get all stock data of big a
Video networkstate property
Understand kotlin from the perspective of an architect
7月华清学习-1
Redis cluster (master-slave) brain crack and solution
Conversion du format de données GPS [facile à comprendre]