zoukankan      html  css  js  c++  java
  • 线上问题分析之java dump文件生成

    一、查看java进程

    jps
    
    or
    
    ps aux | grep java

    二、生成dump文件

    jmap -dump:live,format=b,file=xxxx.bin 进程ID

    三、查看dump文件:

    jhat启动分析web服务:

     jhat -J-mx512m xxxx.bin
    Reading from xxxx.bin...
    Dump file created Thu Mar 19 18:23:18 CST 2020
    Snapshot read, resolving...
    Resolving 1511510 objects...
    Chasing references, expect 302 dots..............................................................................................................................................................................................................................................................................................................
    Eliminating duplicate references..............................................................................................................................................................................................................................................................................................................
    Snapshot resolved.
    Started HTTP server on port 7000
    Server is ready.

    or

    jvisualvm 启动可视化工具

     

    四、查看线程栈

    jstack 进程ID

    五、gc 查看

    jstat -gc 进程ID //实时gc
    S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT 10752.0 10752.0 0.0 0.0 65536.0 36715.2 175104.0 0.0 4480.0 779.9 384.0 76.4 0 0.000 0 0.000 0.000
    jstat -gc 6750 1000 10 //间隔1s,打印10s
    S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT 10752.0 10752.0 0.0 0.0 65536.0 36715.2 175104.0 0.0 4480.0 779.9 384.0 76.4 0 0.000 0 0.000 0.000 10752.0 10752.0 0.0 0.0 65536.0 36715.2 175104.0 0.0 4480.0 779.9 384.0 76.4 0 0.000 0 0.000 0.000 10752.0 10752.0 0.0 0.0 65536.0 36715.2 175104.0 0.0 4480.0 779.9 384.0 76.4 0 0.000 0 0.000 0.000 10752.0 10752.0 0.0 0.0 65536.0 36715.2 175104.0 0.0 4480.0 779.9 384.0 76.4 0 0.000 0 0.000 0.000 10752.0 10752.0 0.0 0.0 65536.0 36715.2 175104.0 0.0 4480.0 779.9 384.0 76.4 0 0.000 0 0.000 0.000 10752.0 10752.0 0.0 0.0 65536.0 36715.2 175104.0 0.0 4480.0 779.9 384.0 76.4 0 0.000 0 0.000 0.000 10752.0 10752.0 0.0 0.0 65536.0 36715.2 175104.0 0.0 4480.0 779.9 384.0 76.4 0 0.000 0 0.000 0.000 10752.0 10752.0 0.0 0.0 65536.0 36715.2 175104.0 0.0 4480.0 779.9 384.0 76.4 0 0.000 0 0.000 0.000 10752.0 10752.0 0.0 0.0 65536.0 36715.2 175104.0 0.0 4480.0 779.9 384.0 76.4 0 0.000 0 0.000 0.000 10752.0 10752.0 0.0 0.0 65536.0 36715.2 175104.0 0.0 4480.0 779.9 384.0 76.4 0 0.000 0 0.000 0.000
  • 相关阅读:
    栈的概念
    什么是 JavaConfig?
    数据库连接池的原理。为什么要使用连接池。
    根据你以往的经验简单叙述一下MYSQL的优化
    动态横切
    横切技术
    什么是AOP
    BIO ,NIO ,AIO 有什么区别?
    简述Comparable和Comparator两个接口的区别
    Spring Boot 客户端?
  • 原文地址:https://www.cnblogs.com/niejunlei/p/12528209.html
Copyright © 2011-2022 走看看