1.开启gc日志
我是用bat文件启动,bat文件和jar同目录
java -jar -Xms256m -Xmx512m -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xloggc:D:subway.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps blade-subway.jar
2.在线gc调优
链接 https://gceasy.io/