Integrated: 8354358: ZGC: ZPartition::prime handle discontiguous reservations correctly

Axel Boldt-Christmas aboldtch at openjdk.org
Mon Apr 14 13:31:59 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.

This pull request has now been integrated.

Changeset: 97e10757
Author:    Axel Boldt-Christmas <aboldtch at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/97e10757392859a46360b4ab379429212fbc34b3
Stats:     34 lines in 3 files changed: 7 ins; 4 del; 23 mod

8354358: ZGC: ZPartition::prime handle discontiguous reservations correctly

Reviewed-by: stefank, jsikstro, eosterlund

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

PR: https://git.openjdk.org/jdk/pull/24589


More information about the hotspot-gc-dev mailing list