RFR: 8323610: G1: HeapRegion pin count should be size_t to avoid overflows [v2]
Thomas Schatzl
tschatzl at openjdk.org
Mon Jan 15 09:08:25 UTC 2024
> 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
Thomas Schatzl has updated the pull request incrementally with one additional commit since the last revision:
copyright updates
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/17390/files
- new: https://git.openjdk.org/jdk/pull/17390/files/bd1eeb38..b835d10c
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=17390&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=17390&range=00-01
Stats: 5 lines in 5 files changed: 0 ins; 0 del; 5 mod
Patch: https://git.openjdk.org/jdk/pull/17390.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/17390/head:pull/17390
PR: https://git.openjdk.org/jdk/pull/17390
More information about the hotspot-gc-dev
mailing list