假设我正在测试Java服务器应用程序.我知道完成测试需要多长时间.现在,我想知道在测试期间在GC上花了多少钱.我该怎么做?
我正在使用-XX:+PrintGCApplicationStoppedTime和-XX:+PrintGCApplicationConcurrentTime选项打开gc日志记录.
但发现只有PrintGCApplicationStoppedTime经过-XX:+PrintGCDetails命令打印的gc日志的4 0r 5打印后我的实际细节!
根据定义,PrintGCApplicationStoppedTime打印应用程序停止每个gc的时间.
但我不清楚为什么它打印如下所示的例子.
是因为
PrintGCApplicationStoppedTime 只需在每个安全点到达后打印
(要么)
日志文件将由不同的gc线程记录.我使用Concurrent扫描完整的GC和年轻一代的ParNew
我的应用是web应用程序.
O/p模式 - 我是这样的:
Application time: 0.3847031 seconds
Total time for which application threads were stopped: 0.3135419 seconds
Application time: 0.1520723 seconds
Total time for which application threads were stopped: 0.1993920 seconds
Application time: 0.1188219 seconds
Total time for which application threads were stopped: 0.1993920 seconds
Application time: 0.1188219 seconds
Total time for which application threads were stopped: 0.1993920 …