< prev index next >

test/compiler/codecache/jmx/PoolsIndependenceTest.java

Print this page




  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import com.oracle.java.testlibrary.Asserts;
  25 import com.oracle.java.testlibrary.Utils;
  26 import java.lang.management.ManagementFactory;
  27 import java.lang.management.MemoryNotificationInfo;
  28 import java.lang.management.MemoryPoolMXBean;
  29 import java.util.HashMap;
  30 import java.util.Map;
  31 import java.util.concurrent.atomic.AtomicInteger;
  32 import javax.management.ListenerNotFoundException;
  33 import javax.management.Notification;
  34 import javax.management.NotificationEmitter;
  35 import javax.management.NotificationListener;
  36 import sun.hotspot.code.BlobType;
  37 
  38 /*
  39  * @test PoolsIndependenceTest
  40  * @ignore 8068385
  41  * @library /testlibrary /../../test/lib
  42  * @build PoolsIndependenceTest

  43  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  44  *     sun.hotspot.WhiteBox$WhiteBoxPermission
  45  * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing
  46  *     -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  47  *     -XX:+SegmentedCodeCache PoolsIndependenceTest
  48  * @summary testing of getUsageThreshold()
  49  */
  50 public class PoolsIndependenceTest implements NotificationListener {
  51 
  52     private final Map<String, AtomicInteger> counters;
  53     private final BlobType btype;
  54     private volatile long lastEventTimestamp;
  55 
  56     public PoolsIndependenceTest(BlobType btype) {
  57         counters = new HashMap<>();
  58         for (BlobType bt : BlobType.getAvailable()) {
  59             counters.put(bt.getMemoryPool().getName(), new AtomicInteger(0));
  60         }
  61         this.btype = btype;
  62         lastEventTimestamp = 0;




  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import com.oracle.java.testlibrary.Asserts;
  25 import com.oracle.java.testlibrary.Utils;
  26 import java.lang.management.ManagementFactory;
  27 import java.lang.management.MemoryNotificationInfo;
  28 import java.lang.management.MemoryPoolMXBean;
  29 import java.util.HashMap;
  30 import java.util.Map;
  31 import java.util.concurrent.atomic.AtomicInteger;
  32 import javax.management.ListenerNotFoundException;
  33 import javax.management.Notification;
  34 import javax.management.NotificationEmitter;
  35 import javax.management.NotificationListener;
  36 import sun.hotspot.code.BlobType;
  37 
  38 /*
  39  * @test PoolsIndependenceTest

  40  * @library /testlibrary /../../test/lib
  41  * @ignore 8068385
  42  * @build com.oracle.java.testlibrary.* PoolsIndependenceTest
  43  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  44  *     sun.hotspot.WhiteBox$WhiteBoxPermission
  45  * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing
  46  *     -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  47  *     -XX:+SegmentedCodeCache PoolsIndependenceTest
  48  * @summary testing of getUsageThreshold()
  49  */
  50 public class PoolsIndependenceTest implements NotificationListener {
  51 
  52     private final Map<String, AtomicInteger> counters;
  53     private final BlobType btype;
  54     private volatile long lastEventTimestamp;
  55 
  56     public PoolsIndependenceTest(BlobType btype) {
  57         counters = new HashMap<>();
  58         for (BlobType bt : BlobType.getAvailable()) {
  59             counters.put(bt.getMemoryPool().getName(), new AtomicInteger(0));
  60         }
  61         this.btype = btype;
  62         lastEventTimestamp = 0;


< prev index next >