当前位置:网站首页>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 .
边栏推荐
- 自动化测试生命周期
- Why do you always fail in automated tests?
- [calculation of loss in yolov3]
- Matlab boundarymask function (find the boundary of the divided area)
- Select drop-down box realizes three-level linkage of provinces and cities in China
- MySQL transaction
- Four operations and derivative operations of MATLAB polynomials
- Image hyperspectral experiment: srcnn/fsrcnn
- Understanding the architecture type of mobile CPU
- Halcon 模板匹配实战代码(一)
猜你喜欢

Uniapp + unicloud + Unipay realize wechat applet payment function

强化学习-学习笔记3 | 策略学习

【TFLite, ONNX, CoreML, TensorRT Export】

How to clear floating?

Embedded software architecture design - message interaction

【pytorch 修改预训练模型:实测加载预训练模型与模型随机初始化差别不大】

Mmclassification training custom data

Network five whip

Course design of compilation principle --- formula calculator (a simple calculator with interface developed based on QT)

Reinforcement learning - learning notes 3 | strategic learning
随机推荐
Simply solve the problem that the node in the redis cluster cannot read data (error) moved
[pytorch pre training model modification, addition and deletion of specific layers]
[configuration method of win11 multi-user simultaneous login remote desktop]
MySQL splits strings for conditional queries
Understanding the architecture type of mobile CPU
mysql拆分字符串做条件查询
Hiengine: comparable to the local cloud native memory database engine
Vscode shortcut key
POJ-2499 Binary Tree
Get data from the database when using JMeter for database assertion
【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
MySQL trigger
Principle of persistence mechanism of redis
Embedded software architecture design - message interaction
Open3d mesh (surface) coloring
Two minutes will take you to quickly master the project structure, resources, dependencies and localization of flutter
Conversion du format de données GPS [facile à comprendre]
想问问,如何选择券商?在线开户是很安全么?
IPv6与IPv4的区别 网信办等三部推进IPv6规模部署
Seven ways to achieve vertical centering