-
Bug
-
Resolution: Unresolved
-
P4
-
23
When 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);
}
}
The difference seems to be that in earlier JDK versions, G1 never reaches the point where adaptive IHOP kicks in, so heap is limited to the default IHOP (45%).
This is also kind of "fixed" (more worked around) with JDK-8048180 eager reclaim of humongous objects with references, but obviously that is incidental.
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);
}
}
The difference seems to be that in earlier JDK versions, G1 never reaches the point where adaptive IHOP kicks in, so heap is limited to the default IHOP (45%).
This is also kind of "fixed" (more worked around) with JDK-8048180 eager reclaim of humongous objects with references, but obviously that is incidental.
- relates to
-
JDK-8245511 G1 adaptive IHOP does not account for reclamation of humongous objects by young GC
-
- Resolved
-
-
JDK-8048180 Eager reclaim of humongous objects with references
-
- Open
-