java追踪垃圾回收

在运行时,加入如下jvm配置

-XX:+PrintGCTimeStamps -XX:-PrintClassHistogram -XX:+PrintHeapAtGC -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationStoppedTime -XX:+HeapDumpOnOutOfMemoryError

结果如下:

81.156: Total time for which application threads were stopped: 0.0001434 seconds
81.157: Total time for which application threads were stopped: 0.0000822 seconds
{Heap before GC invocations=17 (full 3):
 PSYoungGen      total 612864K, used 590848K [0x000000076b380000, 0x000000079bd00000, 0x00000007c0000000)
  eden space 590848K, 100% used [0x000000076b380000,0x000000078f480000,0x000000078f480000)
  from space 22016K, 0% used [0x000000078f480000,0x000000078f480000,0x0000000790a00000)
  to   space 20992K, 0% used [0x000000079a880000,0x000000079a880000,0x000000079bd00000)
 ParOldGen       total 228864K, used 55402K [0x00000006c1a00000, 0x00000006cf980000, 0x000000076b380000)
  object space 228864K, 24% used [0x00000006c1a00000,0x00000006c501abe0,0x00000006cf980000)
 Metaspace       used 62079K, capacity 63014K, committed 63384K, reserved 1105920K
  class space    used 7577K, capacity 7771K, committed 7832K, reserved 1048576K
81.175: [GC (Allocation Failure) [PSYoungGen: 590848K->6748K(713728K)] 646250K->62159K(942592K), 0.0060009 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 
Heap after GC invocations=17 (full 3):
 PSYoungGen      total 713728K, used 6748K [0x000000076b380000, 0x000000079af80000, 0x00000007c0000000)
  eden space 706560K, 0% used [0x000000076b380000,0x000000076b380000,0x0000000796580000)
  from space 7168K, 94% used [0x000000079a880000,0x000000079af170a8,0x000000079af80000)
  to   space 21504K, 0% used [0x0000000798580000,0x0000000798580000,0x0000000799a80000)
 ParOldGen       total 228864K, used 55410K [0x00000006c1a00000, 0x00000006cf980000, 0x000000076b380000)
  object space 228864K, 24% used [0x00000006c1a00000,0x00000006c501cbe0,0x00000006cf980000)
 Metaspace       used 62079K, capacity 63014K, committed 63384K, reserved 1105920K
  class space    used 7577K, capacity 7771K, committed 7832K, reserved 1048576K
}
81.181: Total time for which application threads were stopped: 0.0063536 seconds
81.321: Total time for which application threads were stopped: 0.0001024 seconds
81.321: Total time for which application threads were stopped: 0.0001510 seconds
81.321: Total time for which application threads were stopped: 0.0000967 seconds
81.341: Total time for which application threads were stopped: 0.0001044 seconds
81.351: Total time for which application threads were stopped: 0.0000907 seconds
81.352: Total time for which application threads were stopped: 0.0000745 seconds
81.352: Total time for which application threads were stopped: 0.0000503 seconds
81.352: Total time for which application threads were stopped: 0.0000370 seconds
81.352: Total time for which application threads were stopped: 0.0000384 seconds
81.352: Total time for which application threads were stopped: 0.0000330 seconds
81.352: Total time for which application threads were stopped: 0.0000319 seconds
81.352: Total time for which application threads were stopped: 0.0000404 seconds
81.352: Total time for which application threads were stopped: 0.0000441 seconds
82.353: Total time for which application threads were stopped: 0.0001843 seconds
86.355: Total time for which application threads were stopped: 0.0002301 seconds
90.358: Total time for which application threads were stopped: 0.0001354 seconds
{Heap before GC invocations=18 (full 3):
 PSYoungGen      total 713728K, used 713308K [0x000000076b380000, 0x000000079af80000, 0x00000007c0000000)
  eden space 706560K, 100% used [0x000000076b380000,0x0000000796580000,0x0000000796580000)
  from space 7168K, 94% used [0x000000079a880000,0x000000079af170a8,0x000000079af80000)
  to   space 21504K, 0% used [0x0000000798580000,0x0000000798580000,0x0000000799a80000)
 ParOldGen       total 228864K, used 55410K [0x00000006c1a00000, 0x00000006cf980000, 0x000000076b380000)
  object space 228864K, 24% used [0x00000006c1a00000,0x00000006c501cbe0,0x00000006cf980000)
 Metaspace       used 62117K, capacity 63078K, committed 63384K, reserved 1105920K
  class space    used 7577K, capacity 7771K, committed 7832K, reserved 1048576K
90.458: [GC (Allocation Failure) [PSYoungGen: 713308K->10224K(760832K)] 768719K->65643K(989696K), 0.0059765 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 
Heap after GC invocations=18 (full 3):
 PSYoungGen      total 760832K, used 10224K [0x000000076b380000, 0x000000079fd80000, 0x00000007c0000000)
  eden space 739328K, 0% used [0x000000076b380000,0x000000076b380000,0x0000000798580000)
  from space 21504K, 47% used [0x0000000798580000,0x0000000798f7c378,0x0000000799a80000)
  to   space 20480K, 0% used [0x000000079e980000,0x000000079e980000,0x000000079fd80000)
 ParOldGen       total 228864K, used 55418K [0x00000006c1a00000, 0x00000006cf980000, 0x000000076b380000)
  object space 228864K, 24% used [0x00000006c1a00000,0x00000006c501ebe0,0x00000006cf980000)
 Metaspace       used 62117K, capacity 63078K, committed 63384K, reserved 1105920K
  class space    used 7577K, capacity 7771K, committed 7832K, reserved 1048576K
}
90.465: Total time for which application threads were stopped: 0.0062805 seconds
91.465: Total time for which application threads were stopped: 0.0001348 seconds
94.467: Total time for which application threads were stopped: 0.0001172 seconds
101.471: Total time for which application threads were stopped: 0.0001161 seconds
103.471: Total time for which application threads were stopped: 0.0001146 seconds
103.471: Total time for which application threads were stopped: 0.0000606 seconds
104.471: Total time for which application threads were stopped: 0.0001169 seconds
{Heap before GC invocations=19 (full 3):
 PSYoungGen      total 760832K, used 749552K [0x000000076b380000, 0x000000079fd80000, 0x00000007c0000000)
  eden space 739328K, 100% used [0x000000076b380000,0x0000000798580000,0x0000000798580000)
  from space 21504K, 47% used [0x0000000798580000,0x0000000798f7c378,0x0000000799a80000)
  to   space 20480K, 0% used [0x000000079e980000,0x000000079e980000,0x000000079fd80000)
 ParOldGen       total 228864K, used 55418K [0x00000006c1a00000, 0x00000006cf980000, 0x000000076b380000)
  object space 228864K, 24% used [0x00000006c1a00000,0x00000006c501ebe0,0x00000006cf980000)
 Metaspace       used 62153K, capacity 63078K, committed 63384K, reserved 1105920K
  class space    used 7577K, capacity 7771K, committed 7832K, reserved 1048576K
105.526: [GC (Allocation Failure) [PSYoungGen: 749552K->8165K(841728K)] 804971K->63592K(1070592K), 0.0045184 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
Heap after GC invocations=19 (full 3):
 PSYoungGen      total 841728K, used 8165K [0x000000076b380000, 0x00000007a0d00000, 0x00000007c0000000)
  eden space 821248K, 0% used [0x000000076b380000,0x000000076b380000,0x000000079d580000)
  from space 20480K, 39% used [0x000000079e980000,0x000000079f1797b0,0x000000079fd80000)
  to   space 20480K, 0% used [0x000000079d580000,0x000000079d580000,0x000000079e980000)
 ParOldGen       total 228864K, used 55426K [0x00000006c1a00000, 0x00000006cf980000, 0x000000076b380000)
  object space 228864K, 24% used [0x00000006c1a00000,0x00000006c5020be0,0x00000006cf980000)
 Metaspace       used 62153K, capacity 63078K, committed 63384K, reserved 1105920K
  class space    used 7577K, capacity 7771K, committed 7832K, reserved 1048576K
}
105.530: Total time for which application threads were stopped: 0.0048247 seconds
106.531: Total time for which application threads were stopped: 0.0001021 seconds
110.553: Total time for which application threads were stopped: 0.0000893 seconds
111.553: Total time for which application threads were stopped: 0.0001149 seconds
{Heap before GC invocations=20 (full 3):
 PSYoungGen      total 841728K, used 829413K [0x000000076b380000, 0x00000007a0d00000, 0x00000007c0000000)
  eden space 821248K, 100% used [0x000000076b380000,0x000000079d580000,0x000000079d580000)
  from space 20480K, 39% used [0x000000079e980000,0x000000079f1797b0,0x000000079fd80000)
  to   space 20480K, 0% used [0x000000079d580000,0x000000079d580000,0x000000079e980000)
 ParOldGen       total 228864K, used 55426K [0x00000006c1a00000, 0x00000006cf980000, 0x000000076b380000)
  object space 228864K, 24% used [0x00000006c1a00000,0x00000006c5020be0,0x00000006cf980000)
 Metaspace       used 62172K, capacity 63078K, committed 63384K, reserved 1105920K
  class space    used 7577K, capacity 7771K, committed 7832K, reserved 1048576K
123.147: [GC (Allocation Failure) [PSYoungGen: 829413K->9125K(841728K)] 884840K->64560K(1070592K), 0.0056110 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
Heap after GC invocations=20 (full 3):
 PSYoungGen      total 841728K, used 9125K [0x000000076b380000, 0x00000007a3500000, 0x00000007c0000000)
  eden space 821248K, 0% used [0x000000076b380000,0x000000076b380000,0x000000079d580000)
  from space 20480K, 44% used [0x000000079d580000,0x000000079de697b0,0x000000079e980000)
  to   space 19456K, 0% used [0x00000007a2200000,0x00000007a2200000,0x00000007a3500000)
 ParOldGen       total 228864K, used 55434K [0x00000006c1a00000, 0x00000006cf980000, 0x000000076b380000)
  object space 228864K, 24% used [0x00000006c1a00000,0x00000006c5022be0,0x00000006cf980000)
 Metaspace       used 62172K, capacity 63078K, committed 63384K, reserved 1105920K
  class space    used 7577K, capacity 7771K, committed 7832K, reserved 1048576K
}
123.152: Total time for which application threads were stopped: 0.0059739 seconds

GC (Allocation Failure)

表示新生代对象太多了,分配空间失败,所以触发了GC

PSYoungGen: 829413K->9125K(841728K)

表示新生代内存GC前后分别为829413K何9125K,总的新生代内存大小为841728K

转载于:https://my.oschina.net/u/3337958/blog/1920401

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值