(base) fms231@qishichengdeMac-mini ~ jinfo -help Usage: jinfo <option> <pid> (to connect to a running process)
where <option> is one of: -flag <name> to print the value of the named VM flag -flag [+|-]<name> to enable or disable the named VM flag -flag <name>=<value> to set the named VM flag to the given value -flags to print VM flags -sysprops to print Java system properties <no option> to print both VM flags and system properties -? | -h | --help | -help to print this help message # 查看某一JVM进程的最大堆内存 # 比如idea上的最大堆内存 (base) fms231@qishichengdeMac-mini ~ jinfo -flag MaxHeapSize 57130 -XX:MaxHeapSize=738197504 # 单位为byte,也就是说这个进程的最大堆内存是738197504byte,也就是704MB # -flags 查看非 JVM 默认参数信息 (base) fms231@qishichengdeMac-mini ~ jinfo -flags 57130 VM Flags: -XX:CICompilerCount=4 -XX:ConcGCThreads=2 -XX:G1ConcRefinementThreads=9 -XX:G1EagerReclaimRemSetThreshold=8 -XX:G1HeapRegionSize=1048576 -XX:GCDrainStackTargetSize=64 -XX:InitialHeapSize=536870912 -XX:MarkStackSize=4194304 -XX:MaxHeapSize=738197504 -XX:MaxNewSize=442499072 -XX:MinHeapDeltaBytes=1048576 -XX:MinHeapSize=8388608 -XX:NonNMethodCodeHeapSize=5839564 -XX:NonProfiledCodeHeapSize=122909338 -XX:ProfiledCodeHeapSize=122909338 -XX:ReservedCodeCacheSize=251658240 -XX:+SegmentedCodeCache -XX:SoftMaxHeapSize=738197504 -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseG1GC -XX:-UseNUMA -XX:-UseNUMAInterleaving # 查看垃圾回收器 (base) fms231@qishichengdeMac-mini ~ jinfo -flag UseConcMarkSwee pGC 57130 no such flag 'UseConcMarkSweepGC' (base) fms231@qishichengdeMac-mini ~ jinfo -flag UseG1GC 57130 -XX:+UseG1GC (base) fms231@qishichengdeMac-mini ~ jinfo -flag UseParallelGC 57130 -XX:-UseParallelGC # 在jdk17中,CMS已经被移除