当前位置:网站首页>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
边栏推荐
- Open3d European clustering
- codeforces每日5题(均1700)-第五天
- leetcode:1200. Minimum absolute difference
- [singleshotmultiboxdetector (SSD, single step multi frame target detection)]
- Linux安装部署LAMP(Apache+MySQL+PHP)
- Two minutes will take you to quickly master the project structure, resources, dependencies and localization of flutter
- Liunx prohibit Ping explain the different usage of traceroute
- MySQL splits strings for conditional queries
- Error modulenotfounderror: no module named 'cv2 aruco‘
- PXE startup configuration and principle
猜你喜欢
互联网公司实习岗位选择与简易版职业发展规划
7月华清学习-1
MySQL splits strings for conditional queries
1 plug-in to handle advertisements in web pages
[yolov5.yaml parsing]
Automated test lifecycle
MySQL storage engine
Riddle 1
Uniapp + unicloud + Unipay realize wechat applet payment function
Select drop-down box realizes three-level linkage of provinces and cities in China
随机推荐
Codeworks 5 questions per day (1700 average) - day 5
MySQL index - extended data
II. Data type
Complete activity switching according to sliding
codeforces每日5题(均1700)-第五天
Redis cluster (master-slave) brain crack and solution
Ncp1342 chip substitute pn8213 65W gallium nitride charger scheme
只是巧合?苹果 iOS16 的神秘技术竟然与中国企业 5 年前产品一致!
mysql拆分字符串做条件查询
Hash tag usage in redis cluster
Is investment and finance suitable for girls? What financial products can girls buy?
Embedded software architecture design - message interaction
Understand kotlin from the perspective of an architect
Mmclassification training custom data
[cloud native | kubernetes] actual battle of ingress case (13)
Image hyperspectral experiment: srcnn/fsrcnn
Video networkState 属性
Want to ask, how to choose a securities firm? Is it safe to open an account online?
Mongodb replica set
Video networkstate property