From 56fc22d6f8658c0c34c9d35be81f9da2c003ef4c Mon Sep 17 00:00:00 2001 From: sla Date: Wed, 29 May 2013 09:42:39 +0200 Subject: [PATCH] 8015440: java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java fails with RuntimeException Summary: Make sure serial gc compacts heap every time Reviewed-by: mchung, brutisso, nloodin --- .../lang/management/MemoryMXBean/ResetPeakMemoryUsage.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java b/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java index 6b02397bd..9e37d6670 100644 --- a/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java +++ b/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java @@ -21,6 +21,11 @@ * questions. */ +/* + * The -XX:MarkSweepAlwaysCompactCount=1 argument below makes sure serial gc + * compacts the heap at every full gc so that the usage is correctly updated. + */ + /* * @test * @bug 4892507 @@ -28,7 +33,7 @@ * @author Mandy Chung * * @build ResetPeakMemoryUsage MemoryUtil - * @run main/othervm -XX:+UseSerialGC -Xmn8m ResetPeakMemoryUsage + * @run main/othervm -XX:+UseSerialGC -XX:MarkSweepAlwaysCompactCount=1 -Xmn8m ResetPeakMemoryUsage * @run main/othervm -XX:+UseConcMarkSweepGC -Xmn8m ResetPeakMemoryUsage * @run main/othervm -XX:+UseParallelGC -Xmn8m ResetPeakMemoryUsage * @run main/othervm -XX:+UseG1GC -Xmn8m -XX:G1HeapRegionSize=1m ResetPeakMemoryUsage -- GitLab