当前位置:网站首页>Learning JVM garbage collection 06 - memory set and card table (hotspot)
Learning JVM garbage collection 06 - memory set and card table (hotspot)
2022-07-05 12:15:00 【The king of early rising】
Catalog
Implementation of memory set ( Card table )
Memory set
What does a memory set do
Here is the memory set , To solve the problems caused by cross generational reference .
Only for the collection of the new generation (Minor GC), What if there are old objects referencing new objects ? It's OK to check the whole elderly generation , But it's not worth it . So the memory set appeared .
What is a memory set
Record from Non collection area Point to Collection area Of the pointer collection Abstract data structure .
Implementation of memory set ( Card table )
As mentioned above , Memory set is an abstract data structure , You need a corresponding concrete implementation .
Think roughly , You can build an array , Store objects with cross generational references in all non collection areas .
Virtual machines think it's too expensive , There is no need to . The collector only needs to know whether there is a pointer to the collection area in a non collection area . therefore , The virtual machine uses a more rugged granularity , Such as word length accuracy ( A machine word length ).
Of course, the accuracy of the object is also ok , But it's not like building an object array as mentioned above , Instead, it is a mark to store whether there is a cross generational pointer .
And that is Card accuracy . It means that each record is accurate to a memory area , There are objects in this area that contain cross generational pointers . Using card precision to realize the data structure of memory set is called Card table .
Card table
stay HotSpot in , The card table is a byte array . Each element in the card table corresponds to a specific size of memory that identifies the memory area . This piece of memory is called card page .HotSpot The card page of is 512 byte . As long as there is a cross generational reference to an object in a card page , The value of the array element corresponding to the card table is marked as 1, It's called dirty elements . If you don't have it, you'll do it 0.
During garbage collection , Filter out the dirty elements in the card , Add them to GC Roots Scan them together .
That's all for the canto .
Keep early hours , take care . The king of early rising wishes you a thousand miles a day
边栏推荐
- 想问问,如何选择券商?在线开户是很安全么?
- Multi table operation - Auto Association query
- GPS数据格式转换[通俗易懂]
- Time tools
- Image hyperspectral experiment: srcnn/fsrcnn
- 多表操作-子查询
- Principle and performance analysis of lepton lossless compression
- Pytorch weight decay and dropout
- Application of a class of identities (vandermond convolution and hypergeometric functions)
- Uniapp + unicloud + Unipay realize wechat applet payment function
猜你喜欢
[loss functions of L1, L2 and smooth L1]
Understand kotlin from the perspective of an architect
Mmclassification training custom data
MySQL splits strings for conditional queries
Take you two minutes to quickly master the route and navigation of flutter
Multi table operation - sub query
abap查表程序
The evolution of mobile cross platform technology
[singleshotmultiboxdetector (SSD, single step multi frame target detection)]
July Huaqing learning-1
随机推荐
MySQL transaction
How to clear floating?
byte2String、string2Byte
Principle and performance analysis of lepton lossless compression
What is digital existence? Digital transformation starts with digital existence
一款新型的智能家居WiFi选择方案——SimpleWiFi在无线智能家居中的应用
只是巧合?苹果 iOS16 的神秘技术竟然与中国企业 5 年前产品一致!
MySQL index - extended data
Codeforces Round #804 (Div. 2)
MySQL regular expression
Mmclassification training custom data
【PyTorch预训练模型修改、增删特定层】
MySQL installation, Windows version
Use and install RkNN toolkit Lite2 on itop-3568 development board NPU
1 plug-in to handle advertisements in web pages
Course design of compilation principle --- formula calculator (a simple calculator with interface developed based on QT)
Matlab boundarymask function (find the boundary of the divided area)
Time tools
Video networkstate property
查看rancher中debug端口信息,并做IDEA Remote Jvm Debug