java -XX:+PrintCommandLineFlags -version
终端环境下,切换到当前程序目录,输入上面的参数,回车,输出如下
-XX:InitialHeapSize=132730432 -XX:MaxHeapSize=2123686912 -XX:+PrintCommandLineFlags -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:-UseLargePagesIndividualAllocat
ion -XX:+UseParallelGC
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
查看垃圾回收器详细信息
java -XX:+PrintGCDetails -version