本文整理匯總了Java中com.sun.management.OperatingSystemMXBean.getArch方法的典型用法代碼示例。如果您正苦於以下問題:Java OperatingSystemMXBean.getArch方法的具體用法?Java OperatingSystemMXBean.getArch怎麽用?Java OperatingSystemMXBean.getArch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sun.management.OperatingSystemMXBean
的用法示例。
在下文中一共展示了OperatingSystemMXBean.getArch方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: VMSummary
import com.sun.management.OperatingSystemMXBean; //導入方法依賴的package包/類
public VMSummary(){
MemoryMXBean bean = ManagementFactory.getMemoryMXBean();
MemoryUsage u = bean.getHeapMemoryUsage();
heapCommitedMemory= (u.getCommitted());
heapUsedMemory=(u.getUsed());
heapMaxMemory=(u.getMax());
u = bean.getNonHeapMemoryUsage();
nonHeapCommitedMemory=(u.getCommitted());
nonHeapUsedMemory=(u.getUsed());
nonHeapMaxMemory=(u.getMax());
ThreadMXBean threadBean = ManagementFactory.getThreadMXBean();
currentThreadCount=threadBean.getThreadCount();
daemonThreadCount= threadBean.getDaemonThreadCount();
totalStartedThreadCount= threadBean.getTotalStartedThreadCount();
peakThreadCount = threadBean.getPeakThreadCount();
ClassLoadingMXBean classLoadingBean = ManagementFactory.getClassLoadingMXBean();
loadedClassCount=classLoadingBean.getLoadedClassCount();
totalLoadedClassCount=classLoadingBean.getTotalLoadedClassCount();
unloadedClassCount=classLoadingBean.getUnloadedClassCount();
getGCStatus();
RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean();
classPath = runtimeBean.getClassPath();
libraryPath = runtimeBean.getLibraryPath();
vmOptions = TextUtils.join(" ",runtimeBean.getInputArguments());
bootClassPath = runtimeBean.getBootClassPath();
upTime = runtimeBean.getUptime();
vmName=runtimeBean.getVmName();
vmVendor= runtimeBean.getVmVendor();
OperatingSystemMXBean osBean= (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
processCpuTime = osBean.getProcessCpuTime();
jdkVersion=System.getProperty("java.version");
jitCompiler=System.getProperty("java.vm.name");
os = osBean.getName() + " "+osBean.getVersion();
osArch = osBean.getArch();
availableProcessors = osBean.getAvailableProcessors();
commitedVirtualMemory = osBean.getCommittedVirtualMemorySize();
freePhysicalMemorySize =(osBean.getFreePhysicalMemorySize());
totalPhysicalMemorySize =(osBean.getTotalPhysicalMemorySize());
freeSwapSpaceSize =(osBean.getFreeSwapSpaceSize());
totalSwapSpaceSize =(osBean.getTotalSwapSpaceSize());
List<GarbageCollectorMXBean> beans = ManagementFactory.getGarbageCollectorMXBeans();
gcInfos = new ArrayList<>(beans.size());
for (GarbageCollectorMXBean b : beans) {
GCBean gcBean = new GCBean();
gcBean.name =b.getName();
gcBean.gcCount = b.getCollectionCount();
gcBean.gcTime = b.getCollectionTime();
gcInfos.add(gcBean);
}
}
示例2: getArchitecture
import com.sun.management.OperatingSystemMXBean; //導入方法依賴的package包/類
public static String getArchitecture() {
OperatingSystemMXBean os = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
return os.getArch();
}