-
Type:
Enhancement
-
Resolution: Unresolved
-
Priority:
P4
-
Affects Version/s: None
-
Component/s: hotspot
With JEP 522 all additions to the card sets are based on linear scans of the heap (refinement and rebuild remsets).
So the FromCardCache, which prevents attempts to add the same card to the remembered set multiple times in a row is not needed in its current form:
currently for every thread there is an entry for every region which indicate that from this card in that region has just been added.
This could be substituted with a per-thread cache that for the current card remembers that that card has just been added to. Since none of the threads repeatedly processes the same card in a single refinement/rebuild scan, this kind of cache is sufficient, having the same effect.
This could save some memory, as the FromCardCache is O(#regions*(MarkingThreads + RefinementThreads)), while this idea is O(size-of-cards * (MarkingThreads + RefinementThreads)) because the number of regions that can be referenced is limited to the number of references in a card.
(Fwiw, actually we should store/compare card set group ids, not regions to improve the effectiveness)
So the FromCardCache, which prevents attempts to add the same card to the remembered set multiple times in a row is not needed in its current form:
currently for every thread there is an entry for every region which indicate that from this card in that region has just been added.
This could be substituted with a per-thread cache that for the current card remembers that that card has just been added to. Since none of the threads repeatedly processes the same card in a single refinement/rebuild scan, this kind of cache is sufficient, having the same effect.
This could save some memory, as the FromCardCache is O(#regions*(MarkingThreads + RefinementThreads)), while this idea is O(size-of-cards * (MarkingThreads + RefinementThreads)) because the number of regions that can be referenced is limited to the number of references in a card.
(Fwiw, actually we should store/compare card set group ids, not regions to improve the effectiveness)