Measuring time spent on GC in JVM

后端 未结 7 1099
天命终不由人
天命终不由人 2020-12-03 01:47

Suppose I am testing a Java server application. I know how much time it takes to finish the test. Now I\'d like to know how much was spent on GC during that test. How can I

7条回答
  •  無奈伤痛
    2020-12-03 02:28

    Another convenient solution is to run jstat -gc (documentation) against your process when your tests are done. That will give you nice aggregated output on exactly how much time has been spent in GC during the lifetime of your JVM.

提交回复
热议问题