JDK-8369111 : G1: Determining concurrent start uses inconsistent predicates
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 26
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-10-03
  • Updated: 2025-11-11
  • Resolved: 2025-11-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26 b23Fixed
Related Reports
Causes :  
Description
G1 only uses the next allocation size in a few cases to determine whether the next gc should be a marking. This unnecessarily delays marking/causing instability in the test here:

I.e. running this program with -Xms100M -Xmx100M, beginning with JDK 23 (b08?) G1 starts behaving very badly as automatic IHOP kicks in: it reduces the heap size to zero, effectively using 5M of heap from then on.

This results in ~900 garbage collections, which are always concurrent start ones.

public class MixedGcHumongous {
    public static void main(String[] args) throws Exception {
        System.gc(); // start from stable state
        for (int i = 0; i < 1000; i++) {
            Integer[] humongous = new Integer[200_000]; Thread.sleep(10); // ~0.8MB (humongous)
            allocateTempNormal(20_000); Thread.sleep(10); // 40 bytes per entry = ~2MB
        }
    }
    static void allocateTempNormal(int count) throws Exception {
        java.util.LinkedList<Integer> temp = new java.util.LinkedList<>();
        for (int j = 0; j < count; j++) temp.add(j);
    }
} 

One cause is that the code to check whether we should do a concurrent start before humongous allocation does take the next allocation into account, while the GC caused by this does not.


Comments
Changeset: 18e8873c Branch: master Author: Thomas Schatzl <tschatzl@openjdk.org> Date: 2025-11-03 14:44:15 +0000 URL: https://git.openjdk.org/jdk/commit/18e8873cadf3900139a6555d4a228148a10d2009
03-11-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/27789 Date: 2025-10-14 08:58:43 +0000
14-10-2025