本文整理汇总了Java中org.openjdk.jol.util.VMSupport类的典型用法代码示例。如果您正苦于以下问题:Java VMSupport类的具体用法?Java VMSupport怎么用?Java VMSupport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VMSupport类属于org.openjdk.jol.util包,在下文中一共展示了VMSupport类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.openjdk.jol.util.VMSupport; //导入依赖的package包/类
@Setup
public void setUp() {
if (VMSupport.addressOf(source) != sourceAddress) {
throw new IllegalArgumentException("source");
}
if (VMSupport.addressOf(destination) != destinationAddress) {
throw new IllegalArgumentException("destination");
}
}
示例2: alignment
import org.openjdk.jol.util.VMSupport; //导入依赖的package包/类
@SuppressWarnings("restriction")
private static long alignment(long[] array) {
long address = VMSupport.addressOf(array);
if (ALIGN_FIRST_ELEMENT) {
address += sun.misc.Unsafe.ARRAY_LONG_BASE_OFFSET;
}
return address % 64;
}
示例3: addressOfElement
import org.openjdk.jol.util.VMSupport; //导入依赖的package包/类
@SuppressWarnings("restriction")
private static long addressOfElement(byte[] array, int index) {
long address = VMSupport.addressOf(array);
address += sun.misc.Unsafe.ARRAY_BYTE_BASE_OFFSET;
address += index;
return address;
}
示例4: main
import org.openjdk.jol.util.VMSupport; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
System.out.println(ClassInitializationBenchmark.class.getSimpleName());
Options opt = new OptionsBuilder()
.include(".*" + ClassInitializationBenchmark.class.getSimpleName() + ".*timeRangecopy_.*")
.timeUnit(TimeUnit.NANOSECONDS).forks(1).mode(Mode.AverageTime).warmupIterations(5)
.measurementIterations(5).build();
System.out.println(VMSupport.vmDetails());
System.out.println(ClassLayout.parseClass(Map2To0Node.class).toPrintable());
new Runner(opt).run();
}
示例5: main
import org.openjdk.jol.util.VMSupport; //导入依赖的package包/类
public static void main(String[] args) {
new Container().printMe();
System.out.println(VMSupport.vmDetails());
System.out.println(ClassLayout.parseClass(Container.class).toPrintable());
System.out.println(GraphLayout.parseInstance(new Container()).toPrintable());
}
示例6: main
import org.openjdk.jol.util.VMSupport; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
System.out.println(BitmapIndexingBenchmark.class.getSimpleName());
Options opt =
new OptionsBuilder().include(".*" + BitmapIndexingBenchmark.class.getSimpleName() + ".*")
.timeUnit(TimeUnit.NANOSECONDS).forks(0).mode(Mode.AverageTime).warmupIterations(5)
.measurementIterations(10).build();
System.out.println(VMSupport.vmDetails());
System.out.println(ClassLayout.parseClass(Map2To0Node.class).toPrintable());
new Runner(opt).run();
}
示例7: main
import org.openjdk.jol.util.VMSupport; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
Class<?> bslotClass = Class.forName("stormpot.BSlot");
Constructor<?> slotConstructor = bslotClass.getConstructor(BlockingQueue.class, AtomicInteger.class);
slotConstructor.setAccessible(true);
Object bslot = slotConstructor.newInstance(null, null);
System.out.println(VMSupport.vmDetails());
System.out.println(ClassLayout.parseClass(bslotClass).toPrintable(bslot));
}
示例8: main
import org.openjdk.jol.util.VMSupport; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
log.info("various vm properties visible via the unsafe");
log.info(VMSupport.vmDetails());
log.info("memory layout based on class object at runtime");
log.info(ClassLayout.parseClass(CodableFieldInfo.class).toPrintable());
log.info("runtime footprint for the standard java string object for 'heylo friend'");
String sample = "heylo friend";
log.info(GraphLayout.parseInstance(sample).toFootprint());
}
示例9: main
import org.openjdk.jol.util.VMSupport; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
log.info("various vm properties visible via the unsafe");
log.info(VMSupport.vmDetails());
log.info("memory layout based on class object at runtime; should see 4 'free bytes' to spend");
log.info(ClassLayout.parseClass(ByteArrayReadOnlyAsciiBuf.class).toPrintable());
log.info("runtime footprint for the standard java string object for 'heylo friend'");
String sample = "heylo friend";
log.info(GraphLayout.parseInstance(sample).toFootprint());
log.info("runtime footprint for a ByteArrayReadOnlyUtfBuf object for 'heylo friend'");
ByteArrayReadOnlyUtfBuf utfBuf = new ByteArrayReadOnlyUtfBuf(sample);
log.info(GraphLayout.parseInstance(utfBuf).toFootprint());
}
示例10: main
import org.openjdk.jol.util.VMSupport; //导入依赖的package包/类
public static void main(String[] args) {
out.println(VMSupport.vmDetails());
PersistentTreeSet<Integer> jmap = PersistentTreeSet.empty();
clojure.lang.PersistentTreeSet cmap = clojure.lang.PersistentTreeSet.EMPTY;
footprint(PerfTest.randomData(50000), jmap, cmap);
}
示例11: main
import org.openjdk.jol.util.VMSupport; //导入依赖的package包/类
public static void main(String[] args) {
System.out.println(VMSupport.vmDetails());
System.out.println(ClassLayout.parseClass(Integer.class).toPrintable());
}
示例12: printObjectAlignment
import org.openjdk.jol.util.VMSupport; //导入依赖的package包/类
static void printObjectAlignment(Object o) {
long objectAddress = VMSupport.addressOf(o);
long firstItemAddress = objectAddress + UNSAFE.arrayBaseOffset(o.getClass());
System.out.println(getAlignment(objectAddress) + "\t" + getAlignment(firstItemAddress));
}