What do -XX:-PrintGC and XX:-PrintGCDetails flags do?

前端 未结 2 1821
庸人自扰
庸人自扰 2020-12-03 05:59

I found the JVM flags here. Is there a more detailed explaination of what exactly they do?

相关标签:
2条回答
  • 2020-12-03 06:03

    Setting this flags writes all the garbage collections made by the JVM to a log file (or stdout, but then it is less useful), and these can be analysed by tools such as the ones mentioned here. Using this information you can fine tune your garbage collection configuration.

    0 讨论(0)
  • 2020-12-03 06:21

    Rather on Sun's, use -Xloggc:gc.log to log to a file, -verbose:gc is also a common switch for this.

    Also, ensure -XX:+PrintGCDetails and -XX:+PrintGCTimeStamps (note the plus + sign). The timestamp switch is redundant but good to include.

    0 讨论(0)
提交回复
热议问题