本文整理汇总了Java中sun.jvm.hotspot.memory.Universe类的典型用法代码示例。如果您正苦于以下问题:Java Universe类的具体用法?Java Universe怎么用?Java Universe使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Universe类属于sun.jvm.hotspot.memory包,在下文中一共展示了Universe类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doit
import sun.jvm.hotspot.memory.Universe; //导入依赖的package包/类
public void doit(Tokens t) {
if (t.countTokens() != 0) {
usage();
} else {
Universe u = VM.getVM().getUniverse();
out.println("Heap Parameters:");
u.heap().printOn(out);
}
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:10,代码来源:CommandProcessor.java
示例2: getUniverse
import sun.jvm.hotspot.memory.Universe; //导入依赖的package包/类
private Universe getUniverse() {
return vm.saUniverse();
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:4,代码来源:ClassLoaderReferenceImpl.java
示例3: saUniverse
import sun.jvm.hotspot.memory.Universe; //导入依赖的package包/类
Universe saUniverse() {
return saUniverse;
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:4,代码来源:VirtualMachineImpl.java
示例4: run
import sun.jvm.hotspot.memory.Universe; //导入依赖的package包/类
@Override
public HotSpotSACompressedReferencesResult run(HotSpotServiceabilityAgentContext context,
NoHotSpotServiceabilityAgentParameter param) {
try {
Class<?> universeClass = HotSpotServiceabilityAgentUtil.getUniverseClass();
Class<?> vmClass = HotSpotServiceabilityAgentUtil.getVmClass();
VM vm = HotSpotServiceabilityAgentUtil.getVMInstance();
Method getKlassOopSizeMethod = null;
Method isCompressedKlassOopsEnabledMethod = null;
Method getNarrowKlassBaseMethod = null;
Method getNarrowKlassShiftMethod = null;
try {
getKlassOopSizeMethod = vmClass.getMethod("getKlassPtrSize");
isCompressedKlassOopsEnabledMethod = vmClass.getMethod("isCompressedKlassPointersEnabled");
getNarrowKlassBaseMethod = universeClass.getMethod("getNarrowKlassBase");
getNarrowKlassShiftMethod = universeClass.getMethod("getNarrowKlassShift");
} catch (NoSuchMethodException e) {
// There is nothing to do, seems target JVM is not Java 8
}
int addressSize = (int) vm.getOopSize();
int objectAlignment = vm.getObjectAlignmentInBytes();
int oopSize = vm.getHeapOopSize();
boolean compressedOopsEnabled = vm.isCompressedOopsEnabled();
long narrowOopBase = Universe.getNarrowOopBase();
int narrowOopShift = Universe.getNarrowOopShift();
/*
* If compressed klass references is not supported (before Java 8),
* use compressed oop references values instead of them.
*/
int klassOopSize = getKlassOopSizeMethod != null ?
(Integer) getKlassOopSizeMethod.invoke(vm) : oopSize;
boolean compressedKlassOopsEnabled = isCompressedKlassOopsEnabledMethod != null ?
(Boolean) isCompressedKlassOopsEnabledMethod.invoke(vm) : compressedOopsEnabled;
long narrowKlassBase = getNarrowKlassBaseMethod != null ?
(Long) getNarrowKlassBaseMethod.invoke(null) : narrowOopBase;
int narrowKlassShift = getNarrowKlassShiftMethod != null ?
(Integer) getNarrowKlassShiftMethod.invoke(null) : narrowOopShift;
return new HotSpotSACompressedReferencesResult(addressSize, objectAlignment,
oopSize, compressedOopsEnabled, narrowOopBase, narrowOopShift,
klassOopSize, compressedKlassOopsEnabled, narrowKlassBase, narrowKlassShift);
} catch (Throwable t) {
throw new RuntimeException(t.getMessage(), t);
}
}
开发者ID:serkan-ozal,项目名称:jemstone,代码行数:52,代码来源:HotSpotSACompressedReferencesWorker.java
注:本文中的sun.jvm.hotspot.memory.Universe类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论