// 获取JVM的参数
Runtime runtime = Runtime.getRuntime();
Properties properties = System.getProperties();
// 打印JVM参数
properties.list(System.out);
// 打印其他JVM信息
System.out.println("CPU核心数: " + runtime.availableProcessors());
System.out.println("总内存: " + runtime.totalMemory() + " bytes");
System.out.println("最大内存: " + runtime.maxMemory() + " bytes");
System.out.println("空闲内存: " + runtime.freeMemory() + " bytes");
获取JVM的参数
最新推荐文章于 2024-06-14 15:02:13 发布