44 /**
45 * Returns the singleton WhiteBox instance.
46 *
47 * The returned WhiteBox object should be carefully guarded
48 * by the caller, since it can be used to read and write data
49 * at arbitrary memory addresses. It must never be passed to
50 * untrusted code.
51 */
52 public synchronized static WhiteBox getWhiteBox() {
53 SecurityManager sm = System.getSecurityManager();
54 if (sm != null) {
55 sm.checkPermission(new WhiteBoxPermission("getInstance"));
56 }
57 return instance;
58 }
59
60 static {
61 registerNatives();
62 }
63
64 // Arguments
65 public native void printHeapSizes();
66
67 // Memory
68 public native long getObjectAddress(Object o);
69 public native int getHeapOopSize();
70
71 // Runtime
72 // Make sure class name is in the correct format
73 public boolean isClassAlive(String name) {
74 return isClassAlive0(name.replace('.', '/'));
75 }
76 private native boolean isClassAlive0(String name);
77
78 // G1
79 public native boolean g1InConcurrentMark();
80 public native boolean g1IsHumongous(Object o);
81 public native long g1NumFreeRegions();
82 public native int g1RegionSize();
83 public native Object[] parseCommandLine(String commandline, DiagnosticCommand[] args);
|
44 /**
45 * Returns the singleton WhiteBox instance.
46 *
47 * The returned WhiteBox object should be carefully guarded
48 * by the caller, since it can be used to read and write data
49 * at arbitrary memory addresses. It must never be passed to
50 * untrusted code.
51 */
52 public synchronized static WhiteBox getWhiteBox() {
53 SecurityManager sm = System.getSecurityManager();
54 if (sm != null) {
55 sm.checkPermission(new WhiteBoxPermission("getInstance"));
56 }
57 return instance;
58 }
59
60 static {
61 registerNatives();
62 }
63
64 public native void printCompressedOopsHeapInfo();
65 // Arguments
66 public native void printHeapSizes();
67
68 // Memory
69 public native long getObjectAddress(Object o);
70 public native int getHeapOopSize();
71
72 // Runtime
73 // Make sure class name is in the correct format
74 public boolean isClassAlive(String name) {
75 return isClassAlive0(name.replace('.', '/'));
76 }
77 private native boolean isClassAlive0(String name);
78
79 // G1
80 public native boolean g1InConcurrentMark();
81 public native boolean g1IsHumongous(Object o);
82 public native long g1NumFreeRegions();
83 public native int g1RegionSize();
84 public native Object[] parseCommandLine(String commandline, DiagnosticCommand[] args);
|