RFR: 8323610: G1: HeapRegion pin count should be size_t to avoid overflows
Kim Barrett
kbarrett at openjdk.org
Fri Jan 12 13:49:21 UTC 2024
On Fri, 12 Jan 2024 08:45:30 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
> Hi all,
>
> please review this change to extend the heap region's pin count to 64 bits (`size_t`) to avoid potential overflows; with uint, only 2^32 pins per regions are possible before overflow, which can be reached fairly quickly using modern computers. Extending the refcount to 64 bits makes it fairly impossible to achieve that in reasonable time.
>
> Obviously this only happens if you do not unpin objects in the meantime.
>
> There is no known failure because of that.
>
> Testing: tier1-5 which is mostly about "it compiles", but some benchmarks do ~7M pins/s, extending the refcount to 64 bits would make overflow take something in the range of 10^9 years instead of a few minutes if I calculated correctly.
>
> Thanks,
> Thomas
Looks good.
-------------
Marked as reviewed by kbarrett (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/17390#pullrequestreview-1818298286
More information about the hotspot-gc-dev
mailing list