当前位置:网站首页>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
边栏推荐
- Halcon template matching actual code (I)
- [mainstream nivida graphics card deep learning / reinforcement learning /ai computing power summary]
- byte2String、string2Byte
- Open3d European clustering
- Automated test lifecycle
- HiEngine:可媲美本地的云原生内存数据库引擎
- 想问问,如何选择券商?在线开户是很安全么?
- Redis cluster (master-slave) brain crack and solution
- Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises
- 多表操作-自关联查询
猜你喜欢
![[pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]](/img/ad/b96e9319212cf2724e0a640109665d.png)
[pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]

Network five whip

Check the debug port information in rancher and do idea remote JVM debug

1 plug-in to handle advertisements in web pages

One article tells the latest and complete learning materials of flutter

Simply solve the problem that the node in the redis cluster cannot read data (error) moved

Error modulenotfounderror: no module named 'cv2 aruco‘

Riddle 1

【PyTorch预训练模型修改、增删特定层】

Matlab struct function (structure array)
随机推荐
Mmclassification training custom data
Uniapp + unicloud + Unipay realize wechat applet payment function
Seven polymorphisms
[pytorch pre training model modification, addition and deletion of specific layers]
[yolov5.yaml parsing]
Pytorch linear regression
Matlab boundarymask function (find the boundary of the divided area)
Swift - add navigation bar
HiEngine:可媲美本地的云原生内存数据库引擎
MySQL view
MySQL installation, Windows version
A guide to threaded and asynchronous UI development in the "quick start fluent Development Series tutorials"
Flutter2 heavy release supports web and desktop applications
Halcon 模板匹配实战代码(一)
Liunx prohibit Ping explain the different usage of traceroute
Master the new features of fluent 2.10
Check the debug port information in rancher and do idea remote JVM debug
PXE startup configuration and principle
只是巧合?苹果 iOS16 的神秘技术竟然与中国企业 5 年前产品一致!
JS for loop number exception