JVM 日志分析

CMS GC 日志分析:https://www.cnblogs.com/onmyway20xx/p/6590603.html 和https://my.oschina.net/go4it/blog/1628795
Elasticsearch gc 日志分析:http://www.imooc.com/article/details/id/80769
-XX:+PrintTenuringDistribution 参数说明:https://blog.csdn.net/pfnie/article/details/52819427
JVM 一次调优过程:https://blog.csdn.net/taoy86/article/details/79746652
REAL TIME IS GREATER THAN USER AND SYS TIME
REDUCE LONG GC PAUSES
频繁GC (Allocation Failure)及young gc时间过长分析
性能调优
i/o, cpu,内存瓶颈
Bulk异常引发的Elasticsearch内存泄漏


2018-12-11T01:45:27.040+0000: 7034128.899: [GC (Allocation Failure) 2018-12-11T01:45:27.040+0000: 7034128.899: [ParNew
Desired survivor size 34865152 bytes, new threshold 1 (max 6)
- age   1:   57619072 bytes,   57619072 total
- age   2:    6903360 bytes,   64522432 total
: 500887K->68096K(613440K), 53.8369943 secs] 23281584K->22911718K(31389184K), 53.8372249 secs] [Times: user=430.11 sys=0.00, real=53.83 secs]
2018-12-11T01:46:20.877+0000: 7034182.736: Total time for which application threads were stopped: 53.8397080 seconds, Stopping threads took: 0.0005160 seconds

日志分析:(增加了参数-XX:+PrintTenuringDistribution 的说明)
Desired survivor size 34865152 bytes: 表示survivor区域允许容纳的最大空间大小为34865152 bytes
age1和age2: 是经过当前gc 后,survivor 的分布情况,64522432 是当前survivior 存储的总大小, 64522432 >34865152 , survivor 区溢出, 调整threshold 大小。
new threshold 1: 因为34865152 < 57619072 , 此次gc 后将threshold 改成1, 下次gc的时候会把 age > new threshold 的对象回收掉。
500887K->68096K(613440K), 53.8369943 secs] :500887K 回收前 新生代的占用量, 68096K 回收后新生代的占用量,613440K 新生代总的容量(eden+from+to)。
23281584K->22911718K(31389184K):23281584K回收前 堆的总的占用量,22911718K回收后堆的总的占用量, 31389184K 堆的总的容量

测试代码:
启动参数:-XX:+UseConcMarkSweepGC -verbose:gc -Xms200M -Xmx200M -XX:+PrintGCDetails -Xmn100M -XX:+PrintTenuringDistribution

public class JvmArgsTest {

    public static void demo(){
        final int tenMB = 10 * 1024 *1024;
        byte[] alloc1, alloc2, alloc3;
        alloc1 = new byte[tenMB / 5];
        alloc2 = new byte[5 * tenMB];
        alloc3 = new byte[4 * tenMB];
    }
    public static void main(String[] str){
        demo();
    }

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值