JVM信息排查

Posted chunxiaozhang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JVM信息排查相关的知识,希望对你有一定的参考价值。

一:jps

使用说明:

技术图片

 示例:

[weblogic@hkczjjapp domain9001]$ jps -l
95696 sun.tools.jps.Jps
45908 weblogic.Server
68048 weblogic.Server

 

二:jstat

使用说明:

技术图片

 示例:

-----查询进程68048的gc情况,250毫秒一次,共5次
[weblogic@hkczjjapp domain9001]$ jstat -gc 68048 250 5 S0C S1C S0U S1U EC EU OC OU PC PU YGC YGCT FGC FGCT GCT 47488.0 32128.0 0.0 32128.0 373696.0 25461.0 699072.0 84432.1 262144.0 137958.3 17 0.495 3 1.055 1.551 47488.0 32128.0 0.0 32128.0 373696.0 25461.0 699072.0 84432.1 262144.0 137958.3 17 0.495 3 1.055 1.551 47488.0 32128.0 0.0 32128.0 373696.0 25461.0 699072.0 84432.1 262144.0 137958.3 17 0.495 3 1.055 1.551 47488.0 32128.0 0.0 32128.0 373696.0 25461.0 699072.0 84432.1 262144.0 137958.3 17 0.495 3 1.055 1.551 47488.0 32128.0 0.0 32128.0 373696.0 25461.0 699072.0 84432.1 262144.0 137958.3 17 0.495 3 1.055 1.551

 

三:jmap

说明:

技术图片

示例:

[weblogic@hkczjjapp domain9001]$ jmap -dump:format=b,file=bb.bin 68048
Dumping heap to /home/weblogic/Oracle/Middleware/user_projects/domains/domain9001/bb.bin ...
Heap dump file created

 

四:jhat

示例:

------解释jmap生成的dump文件生成网页内容
[weblogic@hkczjjapp domain9001]$ jhat bb.bin Reading
from bb.bin... Dump file created Fri Nov 22 13:58:24 CST 2019 Snapshot read, resolving... Resolving 4754263 objects... WARNING: Failed to resolve object id 0x766506d38 for field constantPoolOop (signature L) WARNING: Failed to resolve object id 0x766506d38 for field constantPoolOop (signature L) WARNING: Failed to resolve object id 0x766506d38 for field constantPoolOop (signature L) Chasing references, expect 950 dots........................................ Eliminating duplicate references.............. Snapshot resolved. Started HTTP server on port 7000 Server is ready.

 

五:jstack

说明:

技术图片

示例:

[weblogic@hkczjjapp domain9001]$ jstack -l 68048
2019-11-22 15:38:30
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.45-b01 mixed mode):

"Attach Listener" daemon prio=10 tid=0x00007f1448001000 nid=0x13797 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"Java2D Disposer" daemon prio=10 tid=0x00007f13fc02f000 nid=0x10b2d in Object.wait() [0x00007f13cdbd6000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x000000078490eae0> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
    - locked <0x000000078490eae0> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
    at sun.java2d.Disposer.run(Disposer.java:127)
    at java.lang.Thread.run(Thread.java:662)

   Locked ownable synchronizers:
    - None

"DynamicListenThread[Default]" daemon prio=10 tid=0x00007f14292d3800 nid=0x10a37 runnable [0x00007f13ce3e2000]
   java.lang.Thread.State: RUNNABLE
    at java.net.PlainSocketImpl.socketAccept(Native Method)
    at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:408)
    - locked <0x00000007841280e0> (a java.net.SocksSocketImpl)
    at java.net.ServerSocket.implAccept(ServerSocket.java:462)
    at java.net.ServerSocket.accept(ServerSocket.java:430)
    at weblogic.socket.WeblogicServerSocket.accept(WeblogicServerSocket.java:38)
    at weblogic.server.channels.DynamicListenThread$SocketAccepter.accept(DynamicListenThread.java:535)
    at weblogic.server.channels.DynamicListenThread$SocketAccepter.access$200(DynamicListenThread.java:417)
    at weblogic.server.channels.DynamicListenThread.run(DynamicListenThread.java:173)
    at java.lang.Thread.run(Thread.java:662)

   Locked ownable synchronizers:
    - None

 

以上是关于JVM信息排查的主要内容,如果未能解决你的问题,请参考以下文章

JVM信息排查

一次排查Jvm线程飙升问题的经历

JVM 问题排查常用工具

JVM命令-java服务器故障排查

一篇文章搞清JVM死锁问题及排查

Java服务问题快速排查指南