-
Bug
-
Resolution: Unresolved
-
P4
-
11, 17, 18, 19
Run this:
$ cat Test.java
import java.lang.management.ManagementFactory;
public class Test {
public static void main(String... args) {
var bean = ManagementFactory.getMemoryMXBean();
System.out.println("MXBean says: " + bean.getHeapMemoryUsage());
}
}
$ java -XX:+UseParallelGC -Xms76m -Xmx76m Test.java
MXBean says: init = 79691776(77824K) used = 9006952(8795K) committed = 76546048(74752K) max = 76546048(74752K)
Note how init > max. This is because generational collectors report "max" as max_capacity(), which excludes one of the survivors, while reporting "init" as the vanilla Xms. The fix on the GC side, in the way they report their initial capacity.
$ cat Test.java
import java.lang.management.ManagementFactory;
public class Test {
public static void main(String... args) {
var bean = ManagementFactory.getMemoryMXBean();
System.out.println("MXBean says: " + bean.getHeapMemoryUsage());
}
}
$ java -XX:+UseParallelGC -Xms76m -Xmx76m Test.java
MXBean says: init = 79691776(77824K) used = 9006952(8795K) committed = 76546048(74752K) max = 76546048(74752K)
Note how init > max. This is because generational collectors report "max" as max_capacity(), which excludes one of the survivors, while reporting "init" as the vanilla Xms. The fix on the GC side, in the way they report their initial capacity.
- links to
-
Review openjdk/jdk/7341