当前位置: 首页>>代码示例>>Java>>正文


Java VMSupport类代码示例

本文整理汇总了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");
	}
}
 
开发者ID:gpanther,项目名称:benchmark-arraycopy,代码行数:11,代码来源:BenchmarkLongArrayCopyStandalone2.java

示例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;
}
 
开发者ID:gpanther,项目名称:benchmark-arraycopy,代码行数:9,代码来源:BenchmarkLongArrayCopyStandalone2.java

示例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;
}
 
开发者ID:gpanther,项目名称:benchmark-arraycopy,代码行数:8,代码来源:BenchmarkAlignment.java

示例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();
}
 
开发者ID:msteindorfer,项目名称:criterion,代码行数:13,代码来源:ClassInitializationBenchmark.java

示例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());

}
 
开发者ID:msteindorfer,项目名称:criterion,代码行数:9,代码来源:TestMemoryLayout.java

示例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();
}
 
开发者ID:msteindorfer,项目名称:criterion,代码行数:13,代码来源:BitmapIndexingBenchmark.java

示例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));
}
 
开发者ID:chrisvest,项目名称:object-pool-benchmarks,代码行数:9,代码来源:BSlotObjectLayout.java

示例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());
}
 
开发者ID:addthis,项目名称:codec,代码行数:12,代码来源:JolExample.java

示例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());
}
 
开发者ID:addthis,项目名称:basis,代码行数:16,代码来源:ByteArrayCharBufJol.java

示例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);
}
 
开发者ID:ssaarela,项目名称:javersion,代码行数:9,代码来源:MemoryFootprint.java

示例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());
}
 
开发者ID:walle-liao,项目名称:jaf-examples,代码行数:5,代码来源:VMSupportTools.java

示例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));
}
 
开发者ID:gpanther,项目名称:benchmark-arraycopy,代码行数:6,代码来源:CheckArrayAlignments_JustAllocate.java


注:本文中的org.openjdk.jol.util.VMSupport类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。