< prev index next >

test/lib/sun/hotspot/gc/GC.java

Print this page




  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 package sun.hotspot.gc;
  25 
  26 import sun.hotspot.WhiteBox;
  27 
  28 /**
  29  * API to obtain information about selected and supported Garbage Collectors
  30  * retrieved from the VM with the WhiteBox API.
  31  */
  32 public enum GC {
  33     /*
  34      * Enum values much match CollectedHeap::Name
  35      */
  36     Serial(1),
  37     Parallel(2),
  38     ConcMarkSweep(3),
  39     G1(4);

  40 
  41     private static final WhiteBox WB = WhiteBox.getWhiteBox();
  42 
  43     private final int name;
  44 
  45     private GC(int name) {
  46         this.name = name;
  47     }
  48 
  49     /**
  50      * @return true if this GC is supported by the VM
  51      */
  52     public boolean isSupported() {
  53         return WB.isGCSupported(name);
  54     }
  55 
  56     /**
  57      * @return true if this GC is currently selected/used
  58      */
  59     public boolean isSelected() {


  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 package sun.hotspot.gc;
  25 
  26 import sun.hotspot.WhiteBox;
  27 
  28 /**
  29  * API to obtain information about selected and supported Garbage Collectors
  30  * retrieved from the VM with the WhiteBox API.
  31  */
  32 public enum GC {
  33     /*
  34      * Enum values much match CollectedHeap::Name
  35      */
  36     Serial(1),
  37     Parallel(2),
  38     ConcMarkSweep(3),
  39     G1(4),
  40     Epsilon(5);
  41 
  42     private static final WhiteBox WB = WhiteBox.getWhiteBox();
  43 
  44     private final int name;
  45 
  46     private GC(int name) {
  47         this.name = name;
  48     }
  49 
  50     /**
  51      * @return true if this GC is supported by the VM
  52      */
  53     public boolean isSupported() {
  54         return WB.isGCSupported(name);
  55     }
  56 
  57     /**
  58      * @return true if this GC is currently selected/used
  59      */
  60     public boolean isSelected() {
< prev index next >