8015440: java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java fails with RuntimeException
authorsla
Wed, 29 May 2013 09:42:39 +0200
changeset 17727 1703e6521c97
parent 17726 4aff99bf471b
child 17728 8bbdf55ba9d4
8015440: java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java fails with RuntimeException Summary: Make sure serial gc compacts heap every time Reviewed-by: mchung, brutisso, nloodin
jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java
--- a/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java	Tue May 28 22:22:48 2013 -0700
+++ b/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java	Wed May 29 09:42:39 2013 +0200
@@ -22,13 +22,18 @@
  */
 
 /*
+ * 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
  * @summary Basic Test for MemoryPool.resetPeakUsage()
  * @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