Mercurial > hg > truffle
comparison test/testlibrary/whitebox/sun/hotspot/WhiteBox.java @ 20357:4bfc44ba0d19
8055098: WB API should be extended to provide information about size and age of object.
Summary: Extend the WhiteBox API to provide information about the size and age of objects. Further add a mechanism to trigger a young GC.
Reviewed-by: tschatzl, sjohanss
Contributed-by: Leonid Mesnik <leonid.mesnik@oracle.com>
author | tschatzl |
---|---|
date | Thu, 21 Aug 2014 16:44:41 +0200 |
parents | 2c6ef90f030a |
children | 833b0f92429a |
comparison
equal
deleted
inserted
replaced
20355:47e8e40b94d3 | 20357:4bfc44ba0d19 |
---|---|
67 public native void printHeapSizes(); | 67 public native void printHeapSizes(); |
68 | 68 |
69 // Memory | 69 // Memory |
70 public native long getObjectAddress(Object o); | 70 public native long getObjectAddress(Object o); |
71 public native int getHeapOopSize(); | 71 public native int getHeapOopSize(); |
72 public native boolean isObjectInOldGen(Object o); | |
73 public native long getObjectSize(Object o); | |
72 | 74 |
73 // Runtime | 75 // Runtime |
74 // Make sure class name is in the correct format | 76 // Make sure class name is in the correct format |
75 public boolean isClassAlive(String name) { | 77 public boolean isClassAlive(String name) { |
76 return isClassAlive0(name.replace('.', '/')); | 78 return isClassAlive0(name.replace('.', '/')); |
143 // Memory | 145 // Memory |
144 public native void readReservedMemory(); | 146 public native void readReservedMemory(); |
145 public native long allocateMetaspace(ClassLoader classLoader, long size); | 147 public native long allocateMetaspace(ClassLoader classLoader, long size); |
146 public native void freeMetaspace(ClassLoader classLoader, long addr, long size); | 148 public native void freeMetaspace(ClassLoader classLoader, long addr, long size); |
147 | 149 |
150 // force Young GC | |
151 public native void youngGC(); | |
152 | |
148 // force Full GC | 153 // force Full GC |
149 public native void fullGC(); | 154 public native void fullGC(); |
150 | 155 |
151 // Tests on ReservedSpace/VirtualSpace classes | 156 // Tests on ReservedSpace/VirtualSpace classes |
152 public native int stressVirtualSpaceResize(long reservedSpaceSize, long magnitude, long iterations); | 157 public native int stressVirtualSpaceResize(long reservedSpaceSize, long magnitude, long iterations); |