RFR: Handle old, pinned regions [v7]

William Kemper wkemper at openjdk.org
Fri Aug 5 23:07:43 UTC 2022


On Fri, 5 Aug 2022 07:30:19 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp line 207:
>> 
>>> 205:     }
>>> 206: 
>>> 207:     size_t garbage = region->garbage();
>> 
>> Is `_region_data` above basically a statically allocated scratchpad array that can be used for temporary storage and calculations, and guarantees that it's at least as big as the number of regions in the heap? Typically you use a subset of that array, e.g. in this case you use a prefix for storing collection set candidates.
>> 
>> Is there any sanity checking to ensure that different uses of it do not inadvertently stomp on each others' data? Perhaps there is some state checking somewhere for this in debug/assert mode? Otherwise, it would seem a bit fragile and might pose maintenance headaches down the line.
>
> Also, may be this mode of use should be documented clearly (along with extending, as necessary, with sufficient state to detect and report stomping -- say in debug / assert mode).

Yes, the `_region_data` is essentially a scratch pad for holding pointers to regions we want to include in mixed collections. The field is only used for this purpose though and it's encapsulated by the heuristic class.

-------------

PR: https://git.openjdk.org/shenandoah/pull/149


More information about the shenandoah-dev mailing list