Home >Java >javaTutorial >jvm memory leak troubleshooting process

jvm memory leak troubleshooting process

(*-*)浩
(*-*)浩forward
2019-09-24 15:41:532910browse

jvm memory leak troubleshooting process

1. Query the process that consumes the most CPU

jps First find out those java processes

top command Check those java processes that consume a lot of CPU

2. Find the thread that takes up the largest memory

1. Command: ps p pid -L -o pcpu,pid, tid, time, tname, cmd

%CPU   PID   TID     TIME TTY      CMD
 0.0 32060 32060 00:00:00 ?        /data/java
 0.0 32060 32061 00:00:00 ?        /data/java

The decimal format of the printing thread is hexadecimal format (the column corresponding to TID):

printf "%x\n"  32061
7d3d

3. Query the corresponding value in jstack Thread information

[root@10-10-244-163 ~]# jstack 32060|grep 7d3d -C 10
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:216)

"Reference Handler" #2 daemon prio=10 os_prio=0 tid=0x00007f6dc0108000 nid=0x7d41 in Object.wait() [0x00007f6da99cb000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:502)
        at java.lang.ref.Reference.tryHandlePending(Reference.java:191)
        - locked <0x00000000c08d0ab8> (a java.lang.ref.Reference$Lock)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)

"main" #1 prio=5 os_prio=0 tid=0x00007f6dc000d000 nid=0x7d3d runnable [0x00007f6dc9e1a000]
   java.lang.Thread.State: RUNNABLE
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
        at java.net.ServerSocket.implAccept(ServerSocket.java:545)
        at java.net.ServerSocket.accept(ServerSocket.java:513)
        at org.apache.catalina.core.StandardServer.await(StandardServer.java:453)
        at org.apache.catalina.startup.Catalina.await(Catalina.java:777)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:723)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

The above is the detailed content of jvm memory leak troubleshooting process. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete