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

空扰寡人 提交于 2019-11-26 16:27:46

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/1815390/what-do-xx-printgc-and-xx-printgcdetails-flags-do

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!