< prev index next >

test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest.java

Print this page
rev 51638 : [mq]: 8210112


  28  *          1) setUsageThreshold() and getUsageThreshold()
  29  *          2) test low memory detection on the old generation.
  30  * @author  Mandy Chung
  31  *
  32  * @requires vm.gc == "null"
  33  * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
  34  * @requires vm.opt.DisableExplicitGC != "true"
  35  * @library /lib/testlibrary/ /test/lib
  36  *
  37  * @build jdk.testlibrary.* LowMemoryTest MemoryUtil RunUtil
  38  * @build sun.hotspot.WhiteBox
  39  * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  40  * @run main/othervm/timeout=600 -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. LowMemoryTest
  41  */
  42 
  43 import java.lang.management.*;
  44 import java.util.*;
  45 import java.util.concurrent.Phaser;
  46 import javax.management.*;
  47 import javax.management.openmbean.CompositeData;
  48 import jdk.testlibrary.ProcessTools;
  49 import jdk.testlibrary.JDKToolFinder;
  50 import jdk.testlibrary.Utils;
  51 
  52 import sun.hotspot.code.Compiler;
  53 
  54 public class LowMemoryTest {
  55     private static final MemoryMXBean mm = ManagementFactory.getMemoryMXBean();
  56     private static final List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
  57     private static final Phaser phaser = new Phaser(2);
  58     private static MemoryPoolMXBean mpool = null;
  59     private static boolean trace = false;
  60     private static boolean testFailed = false;
  61     private static final int NUM_TRIGGERS = 5;
  62     private static final int NUM_CHUNKS = 2;
  63     private static final int YOUNG_GEN_SIZE = 8 * 1024 * 1024;
  64     private static long chunkSize;
  65     private static final String classMain = "LowMemoryTest$TestMain";
  66 
  67     /**
  68      * Run the test multiple times with different GC versions.




  28  *          1) setUsageThreshold() and getUsageThreshold()
  29  *          2) test low memory detection on the old generation.
  30  * @author  Mandy Chung
  31  *
  32  * @requires vm.gc == "null"
  33  * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
  34  * @requires vm.opt.DisableExplicitGC != "true"
  35  * @library /lib/testlibrary/ /test/lib
  36  *
  37  * @build jdk.testlibrary.* LowMemoryTest MemoryUtil RunUtil
  38  * @build sun.hotspot.WhiteBox
  39  * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  40  * @run main/othervm/timeout=600 -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. LowMemoryTest
  41  */
  42 
  43 import java.lang.management.*;
  44 import java.util.*;
  45 import java.util.concurrent.Phaser;
  46 import javax.management.*;
  47 import javax.management.openmbean.CompositeData;
  48 import jdk.test.lib.process.ProcessTools;
  49 import jdk.testlibrary.JDKToolFinder;
  50 import jdk.testlibrary.Utils;
  51 
  52 import sun.hotspot.code.Compiler;
  53 
  54 public class LowMemoryTest {
  55     private static final MemoryMXBean mm = ManagementFactory.getMemoryMXBean();
  56     private static final List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
  57     private static final Phaser phaser = new Phaser(2);
  58     private static MemoryPoolMXBean mpool = null;
  59     private static boolean trace = false;
  60     private static boolean testFailed = false;
  61     private static final int NUM_TRIGGERS = 5;
  62     private static final int NUM_CHUNKS = 2;
  63     private static final int YOUNG_GEN_SIZE = 8 * 1024 * 1024;
  64     private static long chunkSize;
  65     private static final String classMain = "LowMemoryTest$TestMain";
  66 
  67     /**
  68      * Run the test multiple times with different GC versions.


< prev index next >