< prev index next >

test/gc/metaspace/TestMetaspacePerfCounters.java

Print this page




  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.util.List;
  25 import java.util.ArrayList;
  26 
  27 import com.oracle.java.testlibrary.*;
  28 import static com.oracle.java.testlibrary.Asserts.*;
  29 
  30 /* @test TestMetaspacePerfCounters
  31  * @bug 8014659
  32  * @requires vm.gc=="null"
  33  * @library /testlibrary
  34  * @summary Tests that performance counters for metaspace and compressed class
  35  *          space exists and works.
  36  *
  37  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseSerialGC TestMetaspacePerfCounters
  38  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseParallelGC -XX:+UseParallelOldGC TestMetaspacePerfCounters
  39  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseG1GC TestMetaspacePerfCounters

  40  *
  41  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseSerialGC TestMetaspacePerfCounters
  42  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseParallelGC -XX:+UseParallelOldGC TestMetaspacePerfCounters
  43  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseG1GC TestMetaspacePerfCounters

  44  */
  45 public class TestMetaspacePerfCounters {
  46     public static Class fooClass = null;
  47     private static final String[] counterNames = {"minCapacity", "maxCapacity", "capacity", "used"};
  48 
  49     public static void main(String[] args) throws Exception {
  50         String metaspace = "sun.gc.metaspace";
  51         String ccs = "sun.gc.compressedclassspace";
  52 
  53         checkPerfCounters(metaspace);
  54 
  55         if (isUsingCompressedClassPointers()) {
  56             checkPerfCounters(ccs);
  57             checkUsedIncreasesWhenLoadingClass(ccs);
  58         } else {
  59             checkEmptyPerfCounters(ccs);
  60             checkUsedIncreasesWhenLoadingClass(metaspace);
  61         }
  62     }
  63 




  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.util.List;
  25 import java.util.ArrayList;
  26 
  27 import com.oracle.java.testlibrary.*;
  28 import static com.oracle.java.testlibrary.Asserts.*;
  29 
  30 /* @test TestMetaspacePerfCounters
  31  * @bug 8014659
  32  * @requires vm.gc=="null"
  33  * @library /testlibrary
  34  * @summary Tests that performance counters for metaspace and compressed class
  35  *          space exists and works.
  36  *
  37  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseSerialGC TestMetaspacePerfCounters
  38  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseParallelGC -XX:+UseParallelOldGC TestMetaspacePerfCounters
  39  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseG1GC TestMetaspacePerfCounters
  40  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC TestMetaspacePerfCounters
  41  *
  42  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseSerialGC TestMetaspacePerfCounters
  43  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseParallelGC -XX:+UseParallelOldGC TestMetaspacePerfCounters
  44  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseG1GC TestMetaspacePerfCounters
  45  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC TestMetaspacePerfCounters
  46  */
  47 public class TestMetaspacePerfCounters {
  48     public static Class fooClass = null;
  49     private static final String[] counterNames = {"minCapacity", "maxCapacity", "capacity", "used"};
  50 
  51     public static void main(String[] args) throws Exception {
  52         String metaspace = "sun.gc.metaspace";
  53         String ccs = "sun.gc.compressedclassspace";
  54 
  55         checkPerfCounters(metaspace);
  56 
  57         if (isUsingCompressedClassPointers()) {
  58             checkPerfCounters(ccs);
  59             checkUsedIncreasesWhenLoadingClass(ccs);
  60         } else {
  61             checkEmptyPerfCounters(ccs);
  62             checkUsedIncreasesWhenLoadingClass(metaspace);
  63         }
  64     }
  65 


< prev index next >