RFR: 8354358: ZGC: ZPartition::prime handle discontiguous reservations correctly
Joel Sikström
jsikstro at openjdk.org
Fri Apr 11 07:05:40 UTC 2025
On Fri, 11 Apr 2025 06:14:42 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:
> Prior to [JDK-8350441](https://bugs.openjdk.org/browse/JDK-8350441) the VM would not have started if we received a discontiguous heap reservation with all reservations smaller than the inital heap capacity. Now we crash because `ZPartition::prime` does not take this into account.
>
> However in contrast to the page cache, the mapped cache makes it trivial to support this scenario. So I propose fixing `ZPartition::prime` to handle any discontiguous heap reservation.
>
> Can be provoked in a debug build by using ZForceDiscontiguousHeapReservations > 16
> `java -XX:+UseZGC -XX:ZForceDiscontiguousHeapReservations=17 -Xmx128m -Xms128m --version`
>
> Currently running this through testing.
src/hotspot/share/gc/z/zPageAllocator.cpp line 1011:
> 1009: const size_t claimed_size = claim_virtual(size, &vmems);
> 1010:
> 1011: // Each partition must have at least size total vmems available when priming.
Maybe something like "The partition must have size available in virtual memory when priming"? I'm reading this as the number of vmems, not the size of them combined.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24589#discussion_r2038925034
More information about the hotspot-gc-dev
mailing list