changeset 17727:1703e6521c97

8015440: java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java fails with RuntimeException Summary: Make sure serial gc compacts heap every time Reviewed-by: mchung, brutisso, nloodin
author sla
date Wed, 29 May 2013 09:42:39 +0200
parents 4aff99bf471b
children 8bbdf55ba9d4
files jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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