RFR: 8323610: G1: HeapRegion pin count should be size_t to avoid overflows
Thomas Schatzl
tschatzl at openjdk.org
Fri Jan 12 13:41:06 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
-------------
Commit messages:
- 8323610
Changes: https://git.openjdk.org/jdk/pull/17390/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17390&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8323610
Stats: 7 lines in 5 files changed: 0 ins; 0 del; 7 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