JAVA获取编译GC内存运行时环境参数信息[ManagementFactory研究,全部Bean方法调用示例]

ManagementFactory是JAVA提供用于监视和管理 Java 虚拟机以及 Java 虚拟机在其上运行的操作系统。它同时允许从本地和远程对正在运行的 Java 虚拟机进行监视和管理,提供JVM堆的使用情况,以及GC情况,线程信息。

用ManagementFactory写对JVM的监控是个不错的选择。

研究ManagementFactory的话,因为提供的Bean比较多,一个个看比较麻烦。

故而用反射获取所有bean,调用bean下的所有无参方法,将结果格式化成报文。这样就能比较全面的看到ManagementFactory提供的能力。然后根据报文,找自己需要的bean和方法,顺瓜摸藤。

依赖
 

    <dependency>
       <groupId>com.alibaba</groupId>
       <artifactId>fastjson</artifactId>
       <version>1.2.71</version>
    </dependency>

代码段如下

 public void invokeAllManagementFactory() throws Exception {
        Method[] methods = ManagementFactory.class.getMethods();
        //保存ManagementFactory下的所有的所有Bean
        List<PlatformManagedObject> list = new LinkedList<>();
        for (Method method : methods) {
            Class<?>[] types = method.getParameterTypes();
            int modifiers = method.getModifiers();
            //如果是静态方法 并且没有参数就直接调用
            if (Modifier.isStatic(modifiers) && types.length == 0) {

                Object invoke = method.invoke(null);
                //返回是list<PlatformManagedObject> 或者 PlatformManagedObject 的放入list
                if (invoke instanceof List) {
                    List l = (List) invoke;
                    l.forEach(i -> {
                        if (i instanceof PlatformManagedObject) {
                            list.add((PlatformManagedObject) i);
                        }
                    });
                } else if (invoke instanceof PlatformManagedObject) {
                    list.add((PlatformManagedObject) invoke);
                }


            }
        }
        Map<String, Map<String, Object>> map = new LinkedHashMap<>();

        for (PlatformManagedObject platformManagedObject : list) {
            //对list里的遍历 执行所有方法 并且以key=methodName value=返回值的行式放到map1里
            LinkedHashMap<String, Object> map1 = new LinkedHashMap<>();
            map.put(platformManagedObject.getObjectName().getCanonicalName(), map1);
            Method[] methods1 = platformManagedObject.getClass().getMethods();
            for (Method method : methods1) {
                Class<?>[] types = method.getParameterTypes();
                if (types.length == 0) {
                    try {
                        method.setAccessible(true);
                        Object invoke = method.invoke(platformManagedObject);
                        map1.put(method.getName(), invoke);
                    } catch (Exception e) {

                    }

                }
            }
        }
        //格式化输出 并且打印所有信息
        //包括 编译 GC 内存 运行时环境 参数信息
        String string = JSON.toJSONString(map, SerializerFeature.PrettyFormat);
        System.out.println(string);
    }

打印报文如下,可以直观得看到ManagementFactory的能力,然后看哪些是自己需要的用来写监控的,去调用相应的bean和方法

{
	"java.lang:type=Compilation":{
		"getName":"HotSpot 64-Bit Tiered Compilers",
		"getTotalCompilationTime":143,
		"getObjectName":{
			"canonicalKeyPropertyListString":"type=Compilation",
			"domain":"java.lang",
			"domainPattern":false,
			"keyPropertyList":{
				"type":"Compilation"
			},
			"keyPropertyListString":"type=Compilation",
			"pattern":false,
			"propertyListPattern":false,
			"propertyPattern":false,
			"propertyValuePattern":false
		},
		"isCompilationTimeMonitoringSupported":true,
		"toString":"sun.management.CompilationImpl@7a46a697",
		"hashCode":2051450519,
		"getClass":"sun.management.CompilationImpl"
	},
	"java.lang:type=ClassLoading":{
		"getTotalLoadedClassCount":1392,
		"getLoadedClassCount":1392,
		"getUnloadedClassCount":0,
		"getObjectName":{
			"canonicalKeyPropertyListString":"type=ClassLoading",
			"domain":"java.lang",
			"domainPattern":false,
			"keyPropertyList":{
				"type":"ClassLoading"
			},
			"keyPropertyListString":"type=ClassLoading",
			"pattern":false,
			"propertyListPattern":false,
			"propertyPattern":false,
			"propertyValuePattern":false
		},
		"isVerbose":false,
		"toString":"sun.management.ClassLoadingImpl@6073f712",
		"hashCode":1618212626,
		"getClass":"sun.management.ClassLoadingImpl"
	},
	"java.lang:type=Threading":{
		"getObjectName":{
			"canonicalKeyPropertyListString":"type=Threading",
			"domain":"java.lang",
			"domainPattern":false,
			"keyPropertyList":{
				"type":"Threading"
			},
			"keyPropertyListString":"type=Threading",
			"pattern":false,
			"propertyListPattern":false,
			"propertyPattern":false,
			"propertyValuePattern":false
		},
		"isThreadCpuTimeSupported":true,
		"isThreadAllocatedMemoryEnabled":true,
		"isThreadAllocatedMemorySupported":true,
		"getAllThreadIds":[6,5,4,3,2,1],
		"getCurrentThreadCpuTime":234375000,
		"getCurrentThreadUserTime":171875000,
		"getDaemonThreadCount":5,
		"getPeakThreadCount":6,
		"getThreadCount":6,
		"getTotalStartedThreadCount":6,
		"isCurrentThreadCpuTimeSupported":true,
		"isObjectMonitorUsageSupported":true,
		"isSynchronizerUsageSupported":true,
		"isThreadContentionMonitoringEnabled":false,
		"isThreadContentionMonitoringSupported":true,
		"isThreadCpuTimeEnabled":true,
		"toString":"sun.management.ThreadImpl@51016012",
		"hashCode":1359044626,
		"getClass":"sun.management.ThreadImpl"
	},
	"java.lang:name=PS Scavenge,type=GarbageCollector":{
		"getObjectName":{
			"canonicalKeyPropertyListString":"name=PS Scavenge,type=GarbageCollector",
			"domain":"java.lang",
			"domainPattern":false,
			"keyPropertyList":{
				"name":"PS Scavenge",
				"type":"GarbageCollector"
			},
			"keyPropertyListString":"type=GarbageCollector,name=PS Scavenge",
			"pattern":false,
			"propertyListPattern":false,
			"propertyPattern":false,
			"propertyValuePattern":false
		},
		"getNotificationInfo":[{
			"description":"GC Notification",
			"name":"javax.management.Notification",
			"notifTypes":["com.sun.management.gc.notification"]
		}],
		"getCollectionCount":1,
		"getCollectionTime":1,
		"getLastGcInfo":{
			"compositeType":{
				"className":"javax.management.openmbean.CompositeData",
				"description":"CompositeType for GC info for PS Scavenge",
				"typeName":"sun.management.PS Scavenge.GcInfoCompositeType"
			},
			"duration":2,
			"endTime":194,
			"id":1,
			"memoryUsageAfterGc":{
				"Compressed Class Space":{
					"committed":1048576,
					"init":0,
					"max":1073741824,
					"used":929224
				},
				"PS Survivor Space":{
					"committed":11010048,
					"init":11010048,
					"max":11010048,
					"used":2170912
				},
				"PS Old Gen":{
					"committed":179306496,
					"init":179306496,
					"max":2852126720,
					"used":8192
				},
				"Metaspace":{
					"committed":8126464,
					"init":0,
					"max":-1,
					"used":7774552
				},
				"PS Eden Space":{
					"committed":67108864,
					"init":67108864,
					"max":1404043264,
					"used":0
				},
				"Code Cache":{
					"committed":2555904,
					"init":2555904,
					"max":251658240,
					"used":2337408
				}
			},
			"memoryUsageBeforeGc":{
				"Compressed Class Space":{
					"committed":1048576,
					"init":0,
					"max":1073741824,
					"used":929224
				},
				"PS Survivor Space":{
					"committed":11010048,
					"init":11010048,
					"max":11010048,
					"used":0
				},
				"PS Old Gen":{
					"committed":179306496,
					"init":179306496,
					"max":2852126720,
					"used":0
				},
				"Metaspace":{
					"committed":8126464,
					"init":0,
					"max":-1,
					"used":7774552
				},
				"PS Eden Space":{
					"committed":67108864,
					"init":67108864,
					"max":1404043264,
					"used":13427488
				},
				"Code Cache":{
					"committed":2555904,
					"init":2555904,
					"max":251658240,
					"used":2337408
				}
			},
			"startTime":192
		},
		"getName":"PS Scavenge",
		"isValid":true,
		"getMemoryPoolNames":["PS Eden Space","PS Survivor Space"],
		"toString":"sun.management.GarbageCollectorImpl@7cef4e59",
		"hashCode":2096057945,
		"getClass":"sun.management.GarbageCollectorImpl"
	},
	"java.lang:name=PS MarkSweep,type=GarbageCollector":{
		"getObjectName":{
			"canonicalKeyPropertyListString":"name=PS MarkSweep,type=GarbageCollector",
			"domain":"java.lang",
			"domainPattern":false,
			"keyPropertyList":{
				"name":"PS MarkSweep",
				"type":"GarbageCollector"
			},
			"keyPropertyListString":"type=GarbageCollector,name=PS MarkSweep",
			"pattern":false,
			"propertyListPattern":false,
			"propertyPattern":false,
			"propertyValuePattern":false
		},
		"getNotificationInfo":[{
			"description":"GC Notification",
			"name":"javax.management.Notification",
			"notifTypes":["com.sun.management.gc.notification"]
		}],
		"getCollectionCount":1,
		"getCollectionTime":7,
		"getLastGcInfo":{
			"compositeType":{
				"className":"javax.management.openmbean.CompositeData",
				"description":"CompositeType for GC info for PS MarkSweep",
				"typeName":"sun.management.PS MarkSweep.GcInfoCompositeType"
			},
			"duration":8,
			"endTime":202,
			"id":1,
			"memoryUsageAfterGc":{
				"Compressed Class Space":{
					"committed":1048576,
					"init":0,
					"max":1073741824,
					"used":929224
				},
				"PS Survivor Space":{
					"committed":11010048,
					"init":11010048,
					"max":11010048,
					"used":0
				},
				"PS Old Gen":{
					"committed":179306496,
					"init":179306496,
					"max":2852126720,
					"used":1979968
				},
				"Metaspace":{
					"committed":8126464,
					"init":0,
					"max":-1,
					"used":7774552
				},
				"PS Eden Space":{
					"committed":67108864,
					"init":67108864,
					"max":1404043264,
					"used":0
				},
				"Code Cache":{
					"committed":2555904,
					"init":2555904,
					"max":251658240,
					"used":2337408
				}
			},
			"memoryUsageBeforeGc":{
				"Compressed Class Space":{
					"committed":1048576,
					"init":0,
					"max":1073741824,
					"used":929224
				},
				"PS Survivor Space":{
					"committed":11010048,
					"init":11010048,
					"max":11010048,
					"used":2170912
				},
				"PS Old Gen":{
					"committed":179306496,
					"init":179306496,
					"max":2852126720,
					"used":8192
				},
				"Metaspace":{
					"committed":8126464,
					"init":0,
					"max":-1,
					"used":7774552
				},
				"PS Eden Space":{
					"committed":67108864,
					"init":67108864,
					"max":1404043264,
					"used":0
				},
				"Code Cache":{
					"committed":2555904,
					"init":2555904,
					"max":251658240,
					"used":2337408
				}
			},
			"startTime":194
		},
		"getName":"PS MarkSweep",
		"isValid":true,
		"getMemoryPoolNames":["PS Eden Space","PS Survivor Space","PS Old Gen"],
		"toString":"sun.management.GarbageCollectorImpl@64b8f8f4",
		"hashCode":1689843956,
		"getClass":"sun.management.GarbageCollectorImpl"
	},
	"java.lang:type=Memory":{
		"getObjectName":{
			"canonicalKeyPropertyListString":"type=Memory",
			"domain":"java.lang",
			"domainPattern":false,
			"keyPropertyList":{
				"type":"Memory"
			},
			"keyPropertyListString":"type=Memory",
			"pattern":false,
			"propertyListPattern":false,
			"propertyPattern":false,
			"propertyValuePattern":false
		},
		"getNotificationInfo":[{
			"description":"Memory Notification",
			"name":"javax.management.Notification",
			"notifTypes":["java.management.memory.threshold.exceeded","java.management.memory.collection.threshold.exceeded"]
		}],
		"isVerbose":false,
		"getHeapMemoryUsage":{
			"committed":257425408,
			"init":268435456,
			"max":3803185152,
			"used":3322144
		},
		"getNonHeapMemoryUsage":{
			"committed":11730944,
			"init":2555904,
			"max":-1,
			"used":11054720
		},
		"getObjectPendingFinalizationCount":75,
		"toString":"sun.management.MemoryImpl@77afea7d",
		"hashCode":2008017533,
		"getClass":"sun.management.MemoryImpl"
	},
	"java.lang:name=CodeCacheManager,type=MemoryManager":{
		"getName":"CodeCacheManager",
		"isValid":true,
		"getObjectName":{
			"canonicalKeyPropertyListString":"name=CodeCacheManager,type=MemoryManager",
			"domain":"java.lang",
			"domainPattern":false,
			"keyPropertyList":{
				"name":"CodeCacheManager",
				"type":"MemoryManager"
			},
			"keyPropertyListString":"type=MemoryManager,name=CodeCacheManager",
			"pattern":false,
			"propertyListPattern":false,
			"propertyPattern":false,
			"propertyValuePattern":false
		},
		"getNotificationInfo":[],
		"getMemoryPoolNames":["Code Cache"],
		"toString":"sun.management.MemoryManagerImpl@3cd1f1c8",
		"hashCode":1020391880,
		"getClass":"sun.management.MemoryManagerImpl"
	},
	"java.lang:name=Metaspace Manager,type=MemoryManager":{
		"getName":"Metaspace Manager",
		"isValid":true,
		"getObjectName":{
			"canonicalKeyPropertyListString":"name=Metaspace Manager,type=MemoryManager",
			"domain":"java.lang",
			"domainPattern":false,
			"keyPropertyList":{
				"name":"Metaspace Manager",
				"type":"MemoryManager"
			},
			"keyPropertyListString":"type=MemoryManager,name=Metaspace Manager",
			"pattern":false,
			"propertyListPattern":false,
			"propertyPattern":false,
			"propertyValuePattern":false
		},
		"getNotificationInfo":[],
		"getMemoryPoolNames":["Metaspace","Compressed Class Space"],
		"toString":"sun.management.MemoryManagerImpl@3a4afd8d",
		"hashCode":977993101,
		"getClass":"sun.management.MemoryManagerImpl"
	},
	"java.lang:name=Code Cache,type=MemoryPool":{
		"getName":"Code Cache",
		"getType":"NON_HEAP",
		"isValid":true,
		"getObjectName":{
			"canonicalKeyPropertyListString":"name=Code Cache,type=MemoryPool",
			"domain":"java.lang",
			"domainPattern":false,
			"keyPropertyList":{
				"name":"Code Cache",
				"type":"MemoryPool"
			},
			"keyPropertyListString":"type=MemoryPool,name=Code Cache",
			"pattern":false,
			"propertyListPattern":false,
			"propertyPattern":false,
			"propertyValuePattern":false
		},
		"getMemoryManagerNames":["CodeCacheManager"],
		"getPeakUsage":{
			"committed":2555904,
			"init":2555904,
			"max":251658240,
			"used":2361024
		},
		"getUsage":{
			"committed":2555904,
			"init":2555904,
			"max":251658240,
			"used":2361024
		},
		"getUsageThreshold":0,
		"getUsageThresholdCount":0,
		"isCollectionUsageThresholdSupported":false,
		"isUsageThresholdExceeded":false,
		"isUsageThresholdSupported":true,
		"toString":"sun.management.MemoryPoolImpl@6d1e7682",
		"hashCode":1830712962,
		"getClass":"sun.management.MemoryPoolImpl"
	},
	"java.lang:name=Metaspace,type=MemoryPool":{
		"getName":"Metaspace",
		"getType":"NON_HEAP",
		"isValid":true,
		"getObjectName":{
			"canonicalKeyPropertyListString":"name=Metaspace,type=MemoryPool",
			"domain":"java.lang",
			"domainPattern":false,
			"keyPropertyList":{
				"name":"Metaspace",
				"type":"MemoryPool"
			},
			"keyPropertyListString":"type=MemoryPool,name=Metaspace",
			"pattern":false,
			"propertyListPattern":false,
			"propertyPattern":false,
			"propertyValuePattern":false
		},
		"getMemoryManagerNames":["Metaspace Manager"],
		"getPeakUsage":{
			"committed":8126464,
			"init":0,
			"max":-1,
			"used":7837960
		},
		"getUsage":{
			"committed":8126464,
			"init":0,
			"max":-1,
			"used":7837960
		},
		"getUsageThreshold":0,
		"getUsageThresholdCount":0,
		"isCollectionUsageThresholdSupported":false,
		"isUsageThresholdExceeded":false,
		"isUsageThresholdSupported":true,
		"toString":"sun.management.MemoryPoolImpl@424c0bc4",
		"hashCode":1112280004,
		"getClass":"sun.management.MemoryPoolImpl"
	},
	"java.lang:name=Compressed Class Space,type=MemoryPool":{
		"getName":"Compressed Class Space",
		"getType":"NON_HEAP",
		"isValid":true,
		"getObjectName":{
			"canonicalKeyPropertyListString":"name=Compressed Class Space,type=MemoryPool",
			"domain":"java.lang",
			"domainPattern":false,
			"keyPropertyList":{
				"name":"Compressed Class Space",
				"type":"MemoryPool"
			},
			"keyPropertyListString":"type=MemoryPool,name=Compressed Class Space",
			"pattern":false,
			"propertyListPattern":false,
			"propertyPattern":false,
			"propertyValuePattern":false
		},
		"getMemoryManagerNames":["Metaspace Manager"],
		"getPeakUsage":{
			"committed":1048576,
			"init":0,
			"max":1073741824,
			"used":937272
		},
		"getUsage":{
			"committed":1048576,
			"init":0,
			"max":1073741824,
			"used":937272
		},
		"getUsageThreshold":0,
		"getUsageThresholdCount":0,
		"isCollectionUsageThresholdSupported":false,
		"isUsageThresholdExceeded":false,
		"isUsageThresholdSupported":true,
		"toString":"sun.management.MemoryPoolImpl@3c679bde",
		"hashCode":1013423070,
		"getClass":"sun.management.MemoryPoolImpl"
	},
	"java.lang:name=PS Eden Space,type=MemoryPool":{
		"getName":"PS Eden Space",
		"getType":"HEAP",
		"isValid":true,
		"getObjectName":{
			"canonicalKeyPropertyListString":"name=PS Eden Space,type=MemoryPool",
			"domain":"java.lang",
			"domainPattern":false,
			"keyPropertyList":{
				"name":"PS Eden Space",
				"type":"MemoryPool"
			},
			"keyPropertyListString":"type=MemoryPool,name=PS Eden Space",
			"pattern":false,
			"propertyListPattern":false,
			"propertyPattern":false,
			"propertyValuePattern":false
		},
		"getCollectionUsage":{
			"committed":67108864,
			"init":67108864,
			"max":1404043264,
			"used":0
		},
		"getCollectionUsageThreshold":0,
		"getCollectionUsageThresholdCount":0,
		"getMemoryManagerNames":["PS MarkSweep","PS Scavenge"],
		"getPeakUsage":{
			"committed":67108864,
			"init":67108864,
			"max":1404043264,
			"used":13427488
		},
		"getUsage":{
			"committed":67108864,
			"init":67108864,
			"max":1404043264,
			"used":1342192
		},
		"isCollectionUsageThresholdExceeded":false,
		"isCollectionUsageThresholdSupported":true,
		"isUsageThresholdSupported":false,
		"toString":"sun.management.MemoryPoolImpl@16b4a017",
		"hashCode":380936215,
		"getClass":"sun.management.MemoryPoolImpl"
	},
	"java.lang:name=PS Survivor Space,type=MemoryPool":{
		"getName":"PS Survivor Space",
		"getType":"HEAP",
		"isValid":true,
		"getObjectName":{
			"canonicalKeyPropertyListString":"name=PS Survivor Space,type=MemoryPool",
			"domain":"java.lang",
			"domainPattern":false,
			"keyPropertyList":{
				"name":"PS Survivor Space",
				"type":"MemoryPool"
			},
			"keyPropertyListString":"type=MemoryPool,name=PS Survivor Space",
			"pattern":false,
			"propertyListPattern":false,
			"propertyPattern":false,
			"propertyValuePattern":false
		},
		"getCollectionUsage":{
			"committed":11010048,
			"init":11010048,
			"max":11010048,
			"used":0
		},
		"getCollectionUsageThreshold":0,
		"getCollectionUsageThresholdCount":0,
		"getMemoryManagerNames":["PS MarkSweep","PS Scavenge"],
		"getPeakUsage":{
			"committed":11010048,
			"init":11010048,
			"max":11010048,
			"used":2170912
		},
		"getUsage":{
			"committed":11010048,
			"init":11010048,
			"max":11010048,
			"used":0
		},
		"isCollectionUsageThresholdExceeded":false,
		"isCollectionUsageThresholdSupported":true,
		"isUsageThresholdSupported":false,
		"toString":"sun.management.MemoryPoolImpl@8807e25",
		"hashCode":142638629,
		"getClass":"sun.management.MemoryPoolImpl"
	},
	"java.lang:name=PS Old Gen,type=MemoryPool":{
		"getName":"PS Old Gen",
		"getType":"HEAP",
		"isValid":true,
		"getObjectName":{
			"canonicalKeyPropertyListString":"name=PS Old Gen,type=MemoryPool",
			"domain":"java.lang",
			"domainPattern":false,
			"keyPropertyList":{
				"name":"PS Old Gen",
				"type":"MemoryPool"
			},
			"keyPropertyListString":"type=MemoryPool,name=PS Old Gen",
			"pattern":false,
			"propertyListPattern":false,
			"propertyPattern":false,
			"propertyValuePattern":false
		},
		"getCollectionUsage":{
			"committed":179306496,
			"init":179306496,
			"max":2852126720,
			"used":1979968
		},
		"getCollectionUsageThreshold":0,
		"getCollectionUsageThresholdCount":0,
		"getMemoryManagerNames":["PS MarkSweep"],
		"getPeakUsage":{
			"committed":179306496,
			"init":179306496,
			"max":2852126720,
			"used":1979968
		},
		"getUsage":{
			"committed":179306496,
			"init":179306496,
			"max":2852126720,
			"used":1979968
		},
		"getUsageThreshold":0,
		"getUsageThresholdCount":0,
		"isCollectionUsageThresholdExceeded":false,
		"isCollectionUsageThresholdSupported":true,
		"isUsageThresholdExceeded":false,
		"isUsageThresholdSupported":true,
		"toString":"sun.management.MemoryPoolImpl@2a3046da",
		"hashCode":707806938,
		"getClass":"sun.management.MemoryPoolImpl"
	},
	"java.lang:type=OperatingSystem":{
		"getCommittedVirtualMemorySize":469323776,
		"getFreePhysicalMemorySize":7017545728,
		"getFreeSwapSpaceSize":4161884160,
		"getProcessCpuLoad":0.10486990091779899,
		"getProcessCpuTime":1109375000,
		"getSystemCpuLoad":0.6793780209758321,
		"getTotalPhysicalMemorySize":17109733376,
		"getTotalSwapSpaceSize":23395414016,
		"getName":"Windows 10",
		"getObjectName":{
			"canonicalKeyPropertyListString":"type=OperatingSystem",
			"domain":"java.lang",
			"domainPattern":false,
			"keyPropertyList":{
				"type":"OperatingSystem"
			},
			"keyPropertyListString":"type=OperatingSystem",
			"pattern":false,
			"propertyListPattern":false,
			"propertyPattern":false,
			"propertyValuePattern":false
		},
		"getVersion":"10.0",
		"getArch":"amd64",
		"getAvailableProcessors":8,
		"getSystemLoadAverage":-1.0,
		"toString":"sun.management.OperatingSystemImpl@3ada9e37",
		"hashCode":987405879,
		"getClass":"sun.management.OperatingSystemImpl"
	},
	"java.lang:type=Runtime":{
		"getName":"25248@DESKTOP-7C3NFSL",
		"getClassPath":"C:\\util\\IntelliJ IDEA 2019.3.3\\lib\\idea_rt.jar;C:\\util\\IntelliJ IDEA 2019.3.3\\plugins\\junit\\lib\\junit5-rt.jar;C:\\util\\IntelliJ IDEA 2019.3.3\\plugins\\junit\\lib\\junit-rt.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\charsets.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\deploy.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\access-bridge-64.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\cldrdata.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\dnsns.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\jaccess.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\jfxrt.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\localedata.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\nashorn.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\sunec.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\sunjce_provider.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\sunmscapi.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\sunpkcs11.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\zipfs.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\javaws.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\jce.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\jfr.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\jfxswt.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\jsse.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\management-agent.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\plugin.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\resources.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\rt.jar;C:\\Users\\Hex\\IdeaProjects\\search-java\\target\\classes;C:\\Users\\Hex\\.m2\\repository\\cglib\\cglib\\2.2.2\\cglib-2.2.2.jar;C:\\Users\\Hex\\.m2\\repository\\asm\\asm\\3.3.1\\asm-3.3.1.jar;C:\\Users\\Hex\\.m2\\repository\\junit\\junit\\4.13\\junit-4.13.jar;C:\\Users\\Hex\\.m2\\repository\\org\\hamcrest\\hamcrest-core\\1.3\\hamcrest-core-1.3.jar;C:\\Users\\Hex\\.m2\\repository\\com\\alibaba\\fastjson\\1.2.71\\fastjson-1.2.71.jar;C:\\util\\IntelliJ IDEA 2019.3.3\\lib\\idea_rt.jar",
		"getObjectName":{
			"canonicalKeyPropertyListString":"type=Runtime",
			"domain":"java.lang",
			"domainPattern":false,
			"keyPropertyList":{
				"type":"Runtime"
			},
			"keyPropertyListString":"type=Runtime",
			"pattern":false,
			"propertyListPattern":false,
			"propertyPattern":false,
			"propertyValuePattern":false
		},
		"getBootClassPath":"C:\\util\\jdk1.8.0_144\\jre\\lib\\resources.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\rt.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\sunrsasign.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\jsse.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\jce.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\charsets.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\jfr.jar;C:\\util\\jdk1.8.0_144\\jre\\classes",
		"getInputArguments":[
			"-ea",
			"-Didea.test.cyclic.buffer.size=1048576",
			"-javaagent:C:\\util\\IntelliJ IDEA 2019.3.3\\lib\\idea_rt.jar=54589:C:\\util\\IntelliJ IDEA 2019.3.3\\bin",
			"-Dfile.encoding=UTF-8"
		],
		"getLibraryPath":"C:\\util\\jdk1.8.0_144\\bin;C:\\Windows\\Sun\\Java\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\util\\anaconda;C:\\Users\\Hex\\AppData\\Local\\Microsoft\\WindowsApps;C:\\util\\node-v10.16.2-win-x64;C:\\util\\Git\\bin;;C:\\util\\Microsoft VS Code\\bin;.",
		"getManagementSpecVersion":"1.2",
		"getSpecName":"Java Virtual Machine Specification",
		"getSpecVendor":"Oracle Corporation",
		"getSpecVersion":"1.8",
		"getStartTime":1592389790898,
		"getSystemProperties":{
			"sun.desktop":"windows",
			"awt.toolkit":"sun.awt.windows.WToolkit",
			"file.encoding.pkg":"sun.io",
			"java.specification.version":"1.8",
			"sun.cpu.isalist":"amd64",
			"sun.jnu.encoding":"GBK",
			"java.class.path":"C:\\util\\IntelliJ IDEA 2019.3.3\\lib\\idea_rt.jar;C:\\util\\IntelliJ IDEA 2019.3.3\\plugins\\junit\\lib\\junit5-rt.jar;C:\\util\\IntelliJ IDEA 2019.3.3\\plugins\\junit\\lib\\junit-rt.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\charsets.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\deploy.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\access-bridge-64.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\cldrdata.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\dnsns.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\jaccess.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\jfxrt.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\localedata.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\nashorn.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\sunec.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\sunjce_provider.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\sunmscapi.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\sunpkcs11.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\ext\\zipfs.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\javaws.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\jce.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\jfr.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\jfxswt.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\jsse.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\management-agent.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\plugin.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\resources.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\rt.jar;C:\\Users\\Hex\\IdeaProjects\\search-java\\target\\classes;C:\\Users\\Hex\\.m2\\repository\\cglib\\cglib\\2.2.2\\cglib-2.2.2.jar;C:\\Users\\Hex\\.m2\\repository\\asm\\asm\\3.3.1\\asm-3.3.1.jar;C:\\Users\\Hex\\.m2\\repository\\junit\\junit\\4.13\\junit-4.13.jar;C:\\Users\\Hex\\.m2\\repository\\org\\hamcrest\\hamcrest-core\\1.3\\hamcrest-core-1.3.jar;C:\\Users\\Hex\\.m2\\repository\\com\\alibaba\\fastjson\\1.2.71\\fastjson-1.2.71.jar;C:\\util\\IntelliJ IDEA 2019.3.3\\lib\\idea_rt.jar",
			"java.vm.vendor":"Oracle Corporation",
			"sun.arch.data.model":"64",
			"idea.test.cyclic.buffer.size":"1048576",
			"user.variant":"",
			"java.vendor.url":"http://java.oracle.com/",
			"user.timezone":"",
			"os.name":"Windows 10",
			"java.vm.specification.version":"1.8",
			"user.country":"CN",
			"sun.java.launcher":"SUN_STANDARD",
			"sun.boot.library.path":"C:\\util\\jdk1.8.0_144\\jre\\bin",
			"sun.java.command":"com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 com.binary.search.gc.TestGc,invokeAllManagementFactory",
			"sun.cpu.endian":"little",
			"user.home":"C:\\Users\\Hex",
			"user.language":"zh",
			"java.specification.vendor":"Oracle Corporation",
			"java.home":"C:\\util\\jdk1.8.0_144\\jre",
			"file.separator":"\\",
			"line.separator":"\r\n",
			"java.vm.specification.vendor":"Oracle Corporation",
			"java.specification.name":"Java Platform API Specification",
			"java.awt.graphicsenv":"sun.awt.Win32GraphicsEnvironment",
			"sun.boot.class.path":"C:\\util\\jdk1.8.0_144\\jre\\lib\\resources.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\rt.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\sunrsasign.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\jsse.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\jce.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\charsets.jar;C:\\util\\jdk1.8.0_144\\jre\\lib\\jfr.jar;C:\\util\\jdk1.8.0_144\\jre\\classes",
			"user.script":"",
			"sun.management.compiler":"HotSpot 64-Bit Tiered Compilers",
			"java.runtime.version":"1.8.0_144-b01",
			"user.name":"Hex",
			"path.separator":";",
			"os.version":"10.0",
			"java.endorsed.dirs":"C:\\util\\jdk1.8.0_144\\jre\\lib\\endorsed",
			"java.runtime.name":"Java(TM) SE Runtime Environment",
			"file.encoding":"UTF-8",
			"java.vm.name":"Java HotSpot(TM) 64-Bit Server VM",
			"java.vendor.url.bug":"http://bugreport.sun.com/bugreport/",
			"java.io.tmpdir":"C:\\Users\\Hex\\AppData\\Local\\Temp\\",
			"java.version":"1.8.0_144",
			"user.dir":"C:\\Users\\Hex\\IdeaProjects\\search-java",
			"os.arch":"amd64",
			"java.vm.specification.name":"Java Virtual Machine Specification",
			"java.awt.printerjob":"sun.awt.windows.WPrinterJob",
			"sun.os.patch.level":"",
			"java.library.path":"C:\\util\\jdk1.8.0_144\\bin;C:\\Windows\\Sun\\Java\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\util\\anaconda;C:\\Users\\Hex\\AppData\\Local\\Microsoft\\WindowsApps;C:\\util\\node-v10.16.2-win-x64;C:\\util\\Git\\bin;;C:\\util\\Microsoft VS Code\\bin;.",
			"java.vm.info":"mixed mode",
			"java.vendor":"Oracle Corporation",
			"java.vm.version":"25.144-b01",
			"java.ext.dirs":"C:\\util\\jdk1.8.0_144\\jre\\lib\\ext;C:\\Windows\\Sun\\Java\\lib\\ext",
			"sun.io.unicode.encoding":"UnicodeLittle",
			"java.class.version":"52.0"
		},
		"getUptime":852,
		"getVmName":"Java HotSpot(TM) 64-Bit Server VM",
		"getVmVendor":"Oracle Corporation",
		"getVmVersion":"25.144-b01",
		"isBootClassPathSupported":true,
		"toString":"sun.management.RuntimeImpl@567d299b",
		"hashCode":1451043227,
		"getClass":"sun.management.RuntimeImpl"
	}
}


 

上一篇:[Linux] 解决virtualbox共享文件夹没有访问权限的问题


下一篇:jvm-第11章:直接内存