JVM monitoring and diagnostic tool - jstack of command

1, Introduction

Jstag (JVM stack trace): used to generate a thread snapshot (virtual machine stack trace) of the specified process of the virtual machine at the current time. A thread snapshot is a collection of method stacks being executed by each thread of the specified process in the current virtual machine

Function of generating thread snapshot: it can be used to locate the causes of long pause of threads, such as deadlock between threads, dead loop, long wait caused by requesting external resources, etc. These are common causes of long pause of threads. When a thread pauses, jstack can be used to display the call stack of each thread.

In thread dump, pay attention to the following status deadlocks: Deadlock, waiting for resources, Waiting on condition, Waiting on monitor entry, blocking, Blocked, Runnable, Suspended

 

2, Create a deadlock program code and use the jstack command to view it

1. Program code

package com.kgf.kgfjavalearning2021.jvm;

/***
 * Deadlock between test threads
 */
public class JstackLockTest {


    public static void main(String[] args) {

        StringBuilder sb1 = new StringBuilder();
        StringBuilder sb2 = new StringBuilder();

        new Thread(new Runnable() {
            @Override
            public void run() {
                synchronized (sb1){
                    sb1.append("a");
                    sb2.append("1");
                    try {
                        Thread.sleep(100);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    synchronized (sb2){
                        sb1.append("b");
                        sb2.append("2");
                        try {
                            Thread.sleep(100);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }
        }).start();

        new Thread(new Runnable() {
            @Override
            public void run() {
                synchronized (sb2){
                    sb1.append("c");
                    sb2.append("3");
                    try {
                        Thread.sleep(100);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    synchronized (sb1){
                        sb1.append("d");
                        sb2.append("4");
                        try {
                            Thread.sleep(100);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }
        }).start();

    }
}

  2. After starting the program, use the jstack command to analyze

    Command: jstack pid

  To view the contents of the output file:

2021-11-30 22:24:12
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.51-b03 mixed mode):

"DestroyJavaVM" #14 prio=5 os_prio=0 tid=0x000000001e712000 nid=0x3b14 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Thread-1" #13 prio=5 os_prio=0 tid=0x000000001e719000 nid=0x2e50 waiting for monitor entry [0x0000000020d5f000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at com.kgf.kgfjavalearning2021.jvm.JstackLockTest$2.run(JstackLockTest.java:50)
	- waiting to lock <0x000000076b92c860> (a java.lang.StringBuilder)
	- locked <0x000000076b92c8a8> (a java.lang.StringBuilder)
	at java.lang.Thread.run(Thread.java:745)

"Thread-0" #12 prio=5 os_prio=0 tid=0x000000001e715000 nid=0x2024 waiting for monitor entry [0x0000000020c5e000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at com.kgf.kgfjavalearning2021.jvm.JstackLockTest$1.run(JstackLockTest.java:26)
	- waiting to lock <0x000000076b92c8a8> (a java.lang.StringBuilder)
	- locked <0x000000076b92c860> (a java.lang.StringBuilder)
	at java.lang.Thread.run(Thread.java:745)

"Service Thread" #11 daemon prio=9 os_prio=0 tid=0x000000001e718000 nid=0x29f4 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread3" #10 daemon prio=9 os_prio=2 tid=0x000000001fcdf800 nid=0x23d4 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread2" #9 daemon prio=9 os_prio=2 tid=0x000000001fcdf000 nid=0x13b4 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" #8 daemon prio=9 os_prio=2 tid=0x000000001fcde000 nid=0x19b0 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #7 daemon prio=9 os_prio=2 tid=0x000000001fcd9800 nid=0x1ec4 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Monitor Ctrl-Break" #6 daemon prio=5 os_prio=0 tid=0x000000001e716000 nid=0x1588 runnable [0x000000002055e000]
   java.lang.Thread.State: RUNNABLE
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
	at java.net.SocketInputStream.read(SocketInputStream.java:170)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
	- locked <0x000000076b98f038> (a java.io.InputStreamReader)
	at java.io.InputStreamReader.read(InputStreamReader.java:184)
	at java.io.BufferedReader.fill(BufferedReader.java:161)
	at java.io.BufferedReader.readLine(BufferedReader.java:324)
	- locked <0x000000076b98f038> (a java.io.InputStreamReader)
	at java.io.BufferedReader.readLine(BufferedReader.java:389)
	at com.intellij.rt.execution.application.AppMainV2$1.run(AppMainV2.java:64)

"Attach Listener" #5 daemon prio=5 os_prio=2 tid=0x000000001e716800 nid=0x33a0 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #4 daemon prio=9 os_prio=2 tid=0x000000001e714800 nid=0xffc runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=1 tid=0x000000001d00e000 nid=0x3590 in Object.wait() [0x000000001fa5f000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x000000076b586f58> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
	- locked <0x000000076b586f58> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)

"Reference Handler" #2 daemon prio=10 os_prio=2 tid=0x000000001d00c800 nid=0x1180 in Object.wait() [0x000000001f95f000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x000000076b586998> (a java.lang.ref.Reference$Lock)
	at java.lang.Object.wait(Object.java:502)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:157)
	- locked <0x000000076b586998> (a java.lang.ref.Reference$Lock)

"VM Thread" os_prio=2 tid=0x000000001e6d2800 nid=0x2384 runnable 

"GC task thread#0 (ParallelGC)" os_prio=0 tid=0x0000000003339800 nid=0x2a20 runnable 

"GC task thread#1 (ParallelGC)" os_prio=0 tid=0x000000000333b000 nid=0x754 runnable 

"GC task thread#2 (ParallelGC)" os_prio=0 tid=0x000000000333d000 nid=0x3240 runnable 

"GC task thread#3 (ParallelGC)" os_prio=0 tid=0x000000000333e800 nid=0x3110 runnable 

"GC task thread#4 (ParallelGC)" os_prio=0 tid=0x0000000003340800 nid=0x3460 runnable 

"GC task thread#5 (ParallelGC)" os_prio=0 tid=0x0000000003342000 nid=0x36d4 runnable 

"GC task thread#6 (ParallelGC)" os_prio=0 tid=0x0000000003346000 nid=0x29a8 runnable 

"GC task thread#7 (ParallelGC)" os_prio=0 tid=0x0000000003347000 nid=0x1c80 runnable 

"GC task thread#8 (ParallelGC)" os_prio=0 tid=0x0000000003348800 nid=0x1e54 runnable 

"GC task thread#9 (ParallelGC)" os_prio=0 tid=0x0000000003349800 nid=0x2460 runnable 

"VM Periodic Task Thread" os_prio=2 tid=0x000000001e9e5000 nid=0x1878 waiting on condition 

JNI global references: 33


Found one Java-level deadlock:
=============================
"Thread-1":
  waiting to lock monitor 0x000000000341e668 (object 0x000000076b92c860, a java.lang.StringBuilder),
  which is held by "Thread-0"
"Thread-0":
  waiting to lock monitor 0x000000000341d278 (object 0x000000076b92c8a8, a java.lang.StringBuilder),
  which is held by "Thread-1"

Java stack information for the threads listed above:
===================================================
"Thread-1":
	at com.kgf.kgfjavalearning2021.jvm.JstackLockTest$2.run(JstackLockTest.java:50)
	- waiting to lock <0x000000076b92c860> (a java.lang.StringBuilder)
	- locked <0x000000076b92c8a8> (a java.lang.StringBuilder)
	at java.lang.Thread.run(Thread.java:745)
"Thread-0":
	at com.kgf.kgfjavalearning2021.jvm.JstackLockTest$1.run(JstackLockTest.java:26)
	- waiting to lock <0x000000076b92c8a8> (a java.lang.StringBuilder)
	- locked <0x000000076b92c860> (a java.lang.StringBuilder)
	at java.lang.Thread.run(Thread.java:745)

Found 1 deadlock.

From the above, we can find that two threads are blocked:

  It can be found that the status of the above thread is as follows:

Thread-1:

      waiting to lock <0x000000076b92c860> (a java.lang.StringBuilder)

      locked <0x000000076b92c8a8> (a java.lang.StringBuilder)

Thread-0:

      waiting to lock <0x000000076b92c8a8> (a java.lang.StringBuilder)
      locked <0x000000076b92c860> (a java.lang.StringBuilder)

Therefore, the above two threads constitute a deadlock

The deadlock is also prompted in our output file:

 

3, Create a sleep program code and use the jstack command to view it

1. Program code

package com.kgf.kgfjavalearning2021.jvm;

/***
 * Sleep problem of test thread
 */
public class JstackSleepTest {

    public static void main(String[] args) {
        System.out.println("hello-1");
        try {
            Thread.sleep(1000*60*10);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("hello-2");
    }
}

The above program is a sleep program with a time limit, which means to continue after 10 minutes of sleep

2. After starting the program, use the jstack command to analyze

    Command: jstack pid

  Contents in output file:

2021-11-30 22:40:01
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.51-b03 mixed mode):

"Service Thread" #11 daemon prio=9 os_prio=0 tid=0x000000001fa51000 nid=0x3abc runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread3" #10 daemon prio=9 os_prio=2 tid=0x000000001f9d6000 nid=0x3aa0 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread2" #9 daemon prio=9 os_prio=2 tid=0x000000001f9d5000 nid=0xa18 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" #8 daemon prio=9 os_prio=2 tid=0x000000001f9d4800 nid=0x1e18 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #7 daemon prio=9 os_prio=2 tid=0x000000001f9d1800 nid=0x39cc waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Monitor Ctrl-Break" #6 daemon prio=5 os_prio=0 tid=0x000000001f9a0800 nid=0x379c runnable [0x000000002025e000]
   java.lang.Thread.State: RUNNABLE
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
	at java.net.SocketInputStream.read(SocketInputStream.java:170)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
	- locked <0x000000076b98ef30> (a java.io.InputStreamReader)
	at java.io.InputStreamReader.read(InputStreamReader.java:184)
	at java.io.BufferedReader.fill(BufferedReader.java:161)
	at java.io.BufferedReader.readLine(BufferedReader.java:324)
	- locked <0x000000076b98ef30> (a java.io.InputStreamReader)
	at java.io.BufferedReader.readLine(BufferedReader.java:389)
	at com.intellij.rt.execution.application.AppMainV2$1.run(AppMainV2.java:64)

"Attach Listener" #5 daemon prio=5 os_prio=2 tid=0x000000001e40c000 nid=0x32dc waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #4 daemon prio=9 os_prio=2 tid=0x000000001e462800 nid=0x1b60 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=1 tid=0x000000001cd1e000 nid=0x2ba0 in Object.wait() [0x000000001f75e000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x000000076b586f58> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
	- locked <0x000000076b586f58> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)

"Reference Handler" #2 daemon prio=10 os_prio=2 tid=0x000000001cd1b800 nid=0x8cc in Object.wait() [0x000000001f65f000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x000000076b586998> (a java.lang.ref.Reference$Lock)
	at java.lang.Object.wait(Object.java:502)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:157)
	- locked <0x000000076b586998> (a java.lang.ref.Reference$Lock)

"main" #1 prio=5 os_prio=0 tid=0x0000000003034000 nid=0x15f4 waiting on condition [0x0000000002b2f000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at com.kgf.kgfjavalearning2021.jvm.JstackSleepTest.main(JstackSleepTest.java:11)

"VM Thread" os_prio=2 tid=0x000000001e3d2800 nid=0x2eb0 runnable 

"GC task thread#0 (ParallelGC)" os_prio=0 tid=0x0000000003049800 nid=0x396c runnable 

"GC task thread#1 (ParallelGC)" os_prio=0 tid=0x000000000304b000 nid=0x3108 runnable 

"GC task thread#2 (ParallelGC)" os_prio=0 tid=0x000000000304d000 nid=0x510 runnable 

"GC task thread#3 (ParallelGC)" os_prio=0 tid=0x000000000304e800 nid=0xd24 runnable 

"GC task thread#4 (ParallelGC)" os_prio=0 tid=0x0000000003050800 nid=0x31b4 runnable 

"GC task thread#5 (ParallelGC)" os_prio=0 tid=0x0000000003052000 nid=0x39b8 runnable 

"GC task thread#6 (ParallelGC)" os_prio=0 tid=0x0000000003056000 nid=0x1bd8 runnable 

"GC task thread#7 (ParallelGC)" os_prio=0 tid=0x0000000003057000 nid=0x418 runnable 

"GC task thread#8 (ParallelGC)" os_prio=0 tid=0x0000000003058800 nid=0x22f4 runnable 

"GC task thread#9 (ParallelGC)" os_prio=0 tid=0x0000000003059800 nid=0x6ec runnable 

"VM Periodic Task Thread" os_prio=2 tid=0x000000001f9de800 nid=0x270 waiting on condition 

JNI global references: 33

From the above output file, we can find that there is a time limited waiting thread. The information is very detailed and easy to locate

 

4, Create a program code for synchronization between threads and use the jstack command to view it

1. Program code

package com.kgf.kgfjavalearning2021.jvm;

/***
 * Synchronization of test threads
 */
public class JstackSyncTest {

    public static void main(String[] args) {

        Number number = new Number();

        Thread t1 = new Thread(number);
        Thread t2 = new Thread(number);

        t1.setName("thread1");
        t2.setName("thread2");

        t1.start();
        t2.start();
    }
}

class Number implements Runnable{

    private int number = 1;

    @Override
    public void run() {
        while (true){
            synchronized (this){
                if (number<100){
                    try {
                        Thread.sleep(500);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    System.out.println(Thread.currentThread().getName()+":"+number);
                    number++;
                }else {
                    break;
                }
            }
        }
    }
}

The above program is a thread synchronization program. The state of the two threads may be in execution state, sleep for a limited time, or blocked

2. After starting the program, use the jstack command to analyze

    Command: jstack pid

  The output file contents are as follows:

2021-11-30 23:00:08
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.51-b03 mixed mode):

"DestroyJavaVM" #14 prio=5 os_prio=0 tid=0x0000000002ce4000 nid=0x3378 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"thread2" #13 prio=5 os_prio=0 tid=0x000000001f776800 nid=0xcd0 waiting for monitor entry [0x000000002071e000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at com.kgf.kgfjavalearning2021.jvm.Number.run(JstackSyncTest.java:31)
	- waiting to lock <0x000000076b92ff18> (a com.kgf.kgfjavalearning2021.jvm.Number)
	at java.lang.Thread.run(Thread.java:745)

"thread1" #12 prio=5 os_prio=0 tid=0x000000001f756000 nid=0xe28 waiting on condition [0x000000002061f000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at com.kgf.kgfjavalearning2021.jvm.Number.run(JstackSyncTest.java:33)
	- locked <0x000000076b92ff18> (a com.kgf.kgfjavalearning2021.jvm.Number)
	at java.lang.Thread.run(Thread.java:745)

"Service Thread" #11 daemon prio=9 os_prio=0 tid=0x000000001f671000 nid=0x3520 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread3" #10 daemon prio=9 os_prio=2 tid=0x000000001e3ca800 nid=0x30d0 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread2" #9 daemon prio=9 os_prio=2 tid=0x000000001e3ca000 nid=0x257c waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" #8 daemon prio=9 os_prio=2 tid=0x000000001e3c9000 nid=0x3910 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #7 daemon prio=9 os_prio=2 tid=0x000000001e3c4800 nid=0x34d4 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Monitor Ctrl-Break" #6 daemon prio=5 os_prio=0 tid=0x000000001e2f9800 nid=0xffc runnable [0x000000001ff1e000]
   java.lang.Thread.State: RUNNABLE
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
	at java.net.SocketInputStream.read(SocketInputStream.java:170)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
	- locked <0x000000076b98ef40> (a java.io.InputStreamReader)
	at java.io.InputStreamReader.read(InputStreamReader.java:184)
	at java.io.BufferedReader.fill(BufferedReader.java:161)
	at java.io.BufferedReader.readLine(BufferedReader.java:324)
	- locked <0x000000076b98ef40> (a java.io.InputStreamReader)
	at java.io.BufferedReader.readLine(BufferedReader.java:389)
	at com.intellij.rt.execution.application.AppMainV2$1.run(AppMainV2.java:64)

"Attach Listener" #5 daemon prio=5 os_prio=2 tid=0x000000001e111000 nid=0xd14 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #4 daemon prio=9 os_prio=2 tid=0x000000001e110800 nid=0x2b78 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=1 tid=0x000000001c9cd000 nid=0x29a8 in Object.wait() [0x000000001f41e000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x000000076b586f58> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
	- locked <0x000000076b586f58> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)

"Reference Handler" #2 daemon prio=10 os_prio=2 tid=0x000000001c9cb800 nid=0x3888 in Object.wait() [0x000000001f31f000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x000000076b586998> (a java.lang.ref.Reference$Lock)
	at java.lang.Object.wait(Object.java:502)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:157)
	- locked <0x000000076b586998> (a java.lang.ref.Reference$Lock)

"VM Thread" os_prio=2 tid=0x000000001e082800 nid=0xc70 runnable 

"GC task thread#0 (ParallelGC)" os_prio=0 tid=0x0000000002cf9800 nid=0x2184 runnable 

"GC task thread#1 (ParallelGC)" os_prio=0 tid=0x0000000002cfb000 nid=0x2ad0 runnable 

"GC task thread#2 (ParallelGC)" os_prio=0 tid=0x0000000002cfd000 nid=0x36a0 runnable 

"GC task thread#3 (ParallelGC)" os_prio=0 tid=0x0000000002cfe800 nid=0x1730 runnable 

"GC task thread#4 (ParallelGC)" os_prio=0 tid=0x0000000002d00800 nid=0x1b7c runnable 

"GC task thread#5 (ParallelGC)" os_prio=0 tid=0x0000000002d02000 nid=0x2968 runnable 

"GC task thread#6 (ParallelGC)" os_prio=0 tid=0x0000000002d06000 nid=0x3bfc runnable 

"GC task thread#7 (ParallelGC)" os_prio=0 tid=0x0000000002d07000 nid=0x3ba0 runnable 

"GC task thread#8 (ParallelGC)" os_prio=0 tid=0x0000000002d08800 nid=0x3054 runnable 

"GC task thread#9 (ParallelGC)" os_prio=0 tid=0x0000000002d09800 nid=0xddc runnable 

"VM Periodic Task Thread" os_prio=2 tid=0x000000001f676000 nid=0x1a04 waiting on condition 

JNI global references: 33

The following two thread states can be found from the above contents:

 

Tags: jvm

Posted on Tue, 30 Nov 2021 19:10:54 -0500 by senorpuerco