update doc

This commit is contained in:
hengyunabc committed 2020-09-23 00:41:01 +08:00
1 parent c1dcc8ff9e
commit f599c74408
133 files changed
+793 -617

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 7c21ccbfdaf6e0577e389109c77b5c66
config: 6fa057b4649087e17d0a5ad55f4c47c1
tags: 645f666f9bcd5a90fca523b33c5a78b7
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>&lt;no title&gt; &mdash; Arthas 3.4.1 documentation</title>
<title>&lt;no title&gt; &mdash; Arthas 3.4.2 documentation</title>
@@ -71,7 +71,7 @@
<div class="version">
3.4.1
3.4.2
</div>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 976 KiB

After

Width:  |  Height:  |  Size: 791 KiB

+53 -35
View File
@@ -18,39 +18,37 @@ When running in Apache Tomcat Alibaba edition, the dashboard will also present t
```
$ dashboard
ID NAME GROUP PRIORITY STATE %CPU TIME INTERRUPTED DAEMON
889 RMI TCP Connection(15)-30.10.166. RMI Runtime 9 RUNNABLE 48 0:5 false true
1077 Timer-for-arthas-dashboard-0 system 9 RUNNABLE 24 0:0 false true
1074 as-selector-daemon system 9 RUNNABLE 12 0:0 false true
284 JMX server connection timeout 284 RMI Runtime 9 TIMED_WAITI 8 0:3 false true
16 Timer-1 main 5 TIMED_WAITI 5 0:9 false true
47 Pandora pandora-qos-reporter Pool main 5 TIMED_WAITI 0 0:0 false true
48 JmonitorClient-CheckThread Pool [ main 5 TIMED_WAITI 0 0:0 false true
49 JmonitorClient-HeartBeat Pool [Th main 5 TIMED_WAITI 0 0:0 false true
50 JmonitorClient-ReaderThread Pool main 5 TIMED_WAITI 0 0:0 false true
957 RMI TCP Connection(16)-30.10.166. RMI Runtime 9 RUNNABLE 0 0:2 false true
51 JmonitorClient-WriterThread Pool main 5 TIMED_WAITI 0 0:0 false true
52 ContainerBackgroundProcessor[Stan main 5 TIMED_WAITI 0 0:0 false true
53 http-bio-8080-Acceptor-0 main 5 RUNNABLE 0 0:2 false true
54 http-bio-8080-AsyncTimeout main 5 TIMED_WAITI 0 0:0 false true
11 GC Daemon system 2 TIMED_WAITI 0 0:0 false true
Memory used total max usage GC
heap 59M 223M 1820M 3.26% gc.ps_scavenge.count 118
ps_eden_space 14M 114M 668M 2.11% gc.ps_scavenge.time(ms) 1890
ps_survivor_space 6M 6M 6M 96.08% gc.ps_marksweep.count 5
ps_old_gen 39M 103M 1365M 2.86% gc.ps_marksweep.time(ms) 1140
nonheap 234M 240M 0M 97.46%
code_cache 46M 47M 240M 19.49%
metaspace 167M 172M 0M 97.36%
Runtime Tomcat
os.name Mac OS X connector http-bio-8080
os.version 10.10.5 QPS 0.00
java.version 1.8.0_60 RT(ms) 1.13
java.home error/s 0.00
received/s 0B
systemload.average 3.44 sent/s 0B
processors 4 threadpool http-bio-8080
uptime 16020s busy 0
ID NAME GROUP PRIORITY STATE %CPU DELTA_TIME TIME INTERRUPTE DAEMON
-1 C2 CompilerThread0 - -1 - 1.55 0.077 0:8.684 false true
53 Timer-for-arthas-dashboard-07b system 5 RUNNABLE 0.08 0.004 0:0.004 false true
22 scheduling-1 main 5 TIMED_WAI 0.06 0.003 0:0.287 false false
-1 C1 CompilerThread0 - -1 - 0.06 0.003 0:2.171 false true
-1 VM Periodic Task Thread - -1 - 0.03 0.001 0:0.092 false true
49 arthas-NettyHttpTelnetBootstra system 5 RUNNABLE 0.02 0.001 0:0.156 false true
16 Catalina-utility-1 main 1 TIMED_WAI 0.0 0.000 0:0.029 false false
-1 G1 Young RemSet Sampling - -1 - 0.0 0.000 0:0.019 false true
17 Catalina-utility-2 main 1 WAITING 0.0 0.000 0:0.025 false false
34 http-nio-8080-ClientPoller main 5 RUNNABLE 0.0 0.000 0:0.016 false true
23 http-nio-8080-BlockPoller main 5 RUNNABLE 0.0 0.000 0:0.011 false true
-1 VM Thread - -1 - 0.0 0.000 0:0.032 false true
-1 Service Thread - -1 - 0.0 0.000 0:0.006 false true
-1 GC Thread#5 - -1 - 0.0 0.000 0:0.043 false true
Memory used total max usage GC
heap 36M 70M 4096M 0.90% gc.g1_young_generation.count 12
g1_eden_space 6M 18M -1 33.33% 86
g1_old_gen 30M 50M 4096M 0.74% gc.g1_old_generation.count 0
g1_survivor_space 491K 2048K -1 24.01% gc.g1_old_generation.time(ms) 0
nonheap 66M 69M -1 96.56%
codeheap_'non-nmethods' 1M 2M 5M 22.39%
metaspace 46M 47M -1 98.01%
Runtime
os.name Mac OS X
os.version 10.15.4
java.version 15
java.home /Library/Java/JavaVirtualMachines/jdk-15.jdk/Contents/Home
systemload.average 10.68
processors 8
uptime 272s
```
### Notes on column headers
@@ -60,11 +58,31 @@ uptime 16020s busy
* GROUP: thread group name
* PRIORITY: thread priority, ranged from 1 to 10. The greater number, the higher priority
* STATE: thread state
* CPU%: the ratio of CPU usage for the thread, sampled every 100ms
* TIME: total running time in `minute:second` format
* CPU%: the ratio of CPU usage for the thread. For example, the sampling interval is 1000ms, and the incremental cpu time
of a thread is 100ms, then the cpu usage rate=100/1000=10%
* DELTA_TIME: incremental CPU time of thread running after the last sampling in `second` format
* TIME: total CPU time of the thread in `minute:second` format
* INTERRUPTED: the thread interruption state
* DAEMON: daemon thread or not
#### JVM internal threads
After Java 8, it is supported to obtain the CPU time of JVM internal threads. These threads only have the name and CPU time,
without ID and status information (display ID is -1).
JVM activities can be observed through internal threads, such as GC, JIT compilation, etc., to perceive the overall status of JVM.
* When the JVM heap/metaspace space is insufficient or OOM, it can be seen that the CPU usage of the GC threads is
significantly higher than other threads.
* After executing commands such as `trace/watch/tt/redefine`, you can see that JIT threads activities become more frequent.
Because the JIT compilation data related to this class is cleared when the JVM hot update the class bytecode, it needs to be recompiled.
JVM internal threads include the following:
* JIT compilation thread: such as `C1 CompilerThread0`, `C2 CompilerThread0`
* GC thread: such as `GC Thread0`, `G1 Young RemSet Sampling`
* Other internal threads: such as`VM Periodic Task Thread`, `VM Thread`, `Service Thread`
### Screenshot
![](../_static/dashboard.png "dashboard")
+80 -53
View File
@@ -13,11 +13,23 @@ thread
|`[n:]`|the top n busiest threads with stack traces printed|
|`[b]`|locate the thread blocking the others|
|[i `<value>`]|specify the interval to collect data to compute CPU ratios (ms)|
|[--all]|Show all matching threads|
> How the CPU ratios are calculated? <br/><br/>
> CPU ratio for a given thread is the CPU time it takes divided by the total CPU time within a specified interval period. It is calculated in the following way: sample CPU times for all the thread by calling `java.lang.management.ThreadMXBean#getThreadCpuTime` first, then sleep for a period (the default value is 100ms, which can be specified by `-i`), then sample CPU times again. By this, we can get the time cost for this period for each thread, then come up with the ratio. <br/><br/>
> Note: this operation consumes CPU time too (`getThreadCpuTime` is time-consuming), therefore it is possible to observe Arthas's thread appears in the list. To avoid this, try to increase sample interval, for example: 5000 ms.<br/><br/>
> If you'd like to check the CPU ratios from the very beginning of the Java process, [show-busy-java-threads](https://github.com/oldratlee/useful-scripts/blob/master/docs/java.md#-show-busy-java-threads) can come to help.
### How the CPU ratios are calculated?
The cpu ratios here is similar to the thread `%CPU` of the linux command `top -H -p <pid>`. During a sampling interval,
the ratio of the incremental cpu time of each thread in the current JVM to the sampling interval time.
> Working principle description:
* Do the first sampling, get the CPU time of all threads ( by calling `java.lang.management.ThreadMXBean#getThreadCpuTime()` and
`sun.management.HotspotThreadMBean.getInternalThreadCpuTimes()` )
* Sleep and wait for an interval (the default is 200ms, the interval can be specified by `-i`)
* Do the second sampling, get the CPU time of all threads, compare the two sampling data, and calculate the incremental CPU time of each thread
* `Thread CPU usage ratio` = `Thread increment CPU time` / `Sampling interval time` * 100%
> Note: this operation consumes CPU time too (`getThreadCpuTime` is time-consuming), therefore it is possible to observe Arthas's thread appears in the list. To avoid this, try to increase sample interval, for example: 5000 ms.<br/>
> Another way to view the thread cpu usage of the Java process, [show-busy-java-threads](https://github.com/oldratlee/useful-scripts/blob/master/docs/java.md#-show-busy-java-threads) can come to help.
### Usage
@@ -25,59 +37,72 @@ thread
```shell
$ thread -n 3
"as-command-execute-daemon" Id=29 cpuUsage=75% RUNNABLE
at sun.management.ThreadImpl.dumpThreads0(Native Method)
at sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:440)
at com.taobao.arthas.core.command.monitor200.ThreadCommand$1.action(ThreadCommand.java:58)
at com.taobao.arthas.core.command.handler.AbstractCommandHandler.execute(AbstractCommandHandler.java:238)
at com.taobao.arthas.core.command.handler.DefaultCommandHandler.handleCommand(DefaultCommandHandler.java:67)
at com.taobao.arthas.core.server.ArthasServer$4.run(ArthasServer.java:276)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Number of locked synchronizers = 1
- java.util.concurrent.ThreadPoolExecutor$Worker@6cd0b6f8
"C1 CompilerThread0" [Internal] cpuUsage=1.63% deltaTime=3ms time=1170ms
"as-session-expire-daemon" Id=25 cpuUsage=24% TIMED_WAITING
at java.lang.Thread.sleep(Native Method)
at com.taobao.arthas.core.server.DefaultSessionManager$2.run(DefaultSessionManager.java:85)
"arthas-command-execute" Id=23 cpuUsage=0.11% deltaTime=0ms time=401ms RUNNABLE
at java.management@11.0.7/sun.management.ThreadImpl.dumpThreads0(Native Method)
at java.management@11.0.7/sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:466)
at com.taobao.arthas.core.command.monitor200.ThreadCommand.processTopBusyThreads(ThreadCommand.java:199)
at com.taobao.arthas.core.command.monitor200.ThreadCommand.process(ThreadCommand.java:122)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.process(AnnotatedCommandImpl.java:82)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.access$100(AnnotatedCommandImpl.java:18)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:111)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:108)
at com.taobao.arthas.core.shell.system.impl.ProcessImpl$CommandProcessTask.run(ProcessImpl.java:385)
at java.base@11.0.7/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base@11.0.7/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base@11.0.7/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base@11.0.7/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base@11.0.7/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base@11.0.7/java.lang.Thread.run(Thread.java:834)
"Reference Handler" Id=2 cpuUsage=0% WAITING on java.lang.ref.Reference$Lock@69ba0f27
at java.lang.Object.wait(Native Method)
- waiting on java.lang.ref.Reference$Lock@69ba0f27
at java.lang.Object.wait(Object.java:503)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)
"VM Periodic Task Thread" [Internal] cpuUsage=0.07% deltaTime=0ms time=584ms
```
#### List all threads' info when no options provided
* Without thread ID, including `[Internal]` means JVM internal thread, refer to the introduction of [dashboard](dashboard.md) command.
* `cpuUsage` is the CPU usage of the thread during the sampling interval, consistent with the data of the [dashboard](dashboard.md) command.
* `deltaTime` is the incremental CPU time of the thread during the sampling interval. If it is less than 1ms, it will be rounded and displayed as 0ms.
* `time` The total CPU time of thread.
**Note:** The thread stack is acquired at the end of the second sampling, which does not indicate that the thread is
processing the same task during the sampling interval. It is recommended that the interval time should not be too long.
The larger the interval time, the more inaccurate.
You can try to specify different intervals according to the specific situation and observe the output results.
#### List first page threads' info when no options provided
By default, they are arranged in descending order of CPU increment time, and only the first page of data is displayed.
```shell
$ thread
Threads Total: 16, NEW: 0, RUNNABLE: 7, BLOCKED: 0, WAITING: 5, TIMED_WAITING: 4, TERMINATED: 0
ID NAME GROUP PRIORITY STATE %CPU TIME INTERRUPTE DAEMON
30 as-command-execute-daemon system 9 RUNNABLE 72 0:0 false true
23 as-session-expire-daemon system 9 TIMED_WAIT 27 0:0 false true
22 Attach Listener system 9 RUNNABLE 0 0:0 false true
11 pool-2-thread-1 main 5 TIMED_WAIT 0 0:0 false false
12 Thread-2 main 5 RUNNABLE 0 0:0 false true
13 pool-3-thread-1 main 5 TIMED_WAIT 0 0:0 false false
25 as-selector-daemon system 9 RUNNABLE 0 0:0 false true
14 Thread-3 main 5 TIMED_WAIT 0 0:0 false false
26 pool-5-thread-1 system 5 WAITING 0 0:0 false false
15 Thread-4 main 5 RUNNABLE 0 0:0 false false
1 main main 5 WAITING 0 0:2 false false
2 Reference Handler system 10 WAITING 0 0:0 false true
3 Finalizer system 8 WAITING 0 0:0 false true
4 Signal Dispatcher system 9 RUNNABLE 0 0:0 false true
20 NonBlockingInputStreamThread main 5 WAITING 0 0:0 false true
21 Thread-8 main 5 RUNNABLE 0 0:0 false true
Threads Total: 33, NEW: 0, RUNNABLE: 9, BLOCKED: 0, WAITING: 3, TIMED_WAITING: 4, TERMINATED: 0, Internal threads: 17
ID NAME GROUP PRIORITY STATE %CPU DELTA_TIME TIME INTERRUPT DAEMON
-1 C2 CompilerThread0 - -1 - 5.06 0.010 0:0.973 false true
-1 C1 CompilerThread0 - -1 - 0.95 0.001 0:0.603 false true
23 arthas-command-execute system 5 RUNNABLE 0.17 0.000 0:0.226 false true
-1 VM Periodic Task Thread - -1 - 0.05 0.000 0:0.094 false true
-1 Sweeper thread - -1 - 0.04 0.000 0:0.011 false true
-1 G1 Young RemSet Sampling - -1 - 0.02 0.000 0:0.025 false true
12 Attach Listener system 9 RUNNABLE 0.0 0.000 0:0.022 false true
11 Common-Cleaner InnocuousThrea 8 TIMED_WAI 0.0 0.000 0:0.000 false true
3 Finalizer system 8 WAITING 0.0 0.000 0:0.000 false true
2 Reference Handler system 10 RUNNABLE 0.0 0.000 0:0.000 false true
4 Signal Dispatcher system 9 RUNNABLE 0.0 0.000 0:0.000 false true
15 arthas-NettyHttpTelnetBootstra system 5 RUNNABLE 0.0 0.000 0:0.029 false true
22 arthas-NettyHttpTelnetBootstra system 5 RUNNABLE 0.0 0.000 0:0.196 false true
24 arthas-NettyHttpTelnetBootstra system 5 RUNNABLE 0.0 0.000 0:0.038 false true
16 arthas-NettyWebsocketTtyBootst system 5 RUNNABLE 0.0 0.000 0:0.001 false true
17 arthas-NettyWebsocketTtyBootst system 5 RUNNABLE 0.0 0.000 0:0.001 false true
```
#### thread --all, show all matching threads
Display all matching threads. Sometimes it is necessary to obtain all the thread data of the JVM for analysis.
#### thread id, show the running stack for the target thread
```shell
@@ -140,6 +165,10 @@ $ thread -b
#### thread -i, specify the sampling interval
* `thread -i 1000`: Count the thread cpu time of the last 1000ms.
* `thread -n 3 -i 1000`: List the 3 busiest thread stacks in 1000ms
```bash
$ thread -n 3 -i 1000
"as-command-execute-daemon" Id=4759 cpuUsage=23% RUNNABLE
@@ -165,11 +194,9 @@ $ thread -n 3 -i 1000
```bash
[arthas@28114]$ thread --state WAITING
Threads Total: 15, NEW: 0, RUNNABLE: 7, BLOCKED: 0, WAITING: 5, TIMED_WAITING: 3, TERMINATED: 0
ID NAME GROUP PRIORITY STATE %CPU TIME INTERRU DAEMON
198 AsyncAppender-Worker-arth system 9 WAITING 0 0:0 false true
3 Finalizer system 8 WAITING 0 0:0 false true
14 RMI Scheduler(0) system 9 WAITING 0 0:0 false true
2 Reference Handler system 10 WAITING 0 0:0 false true
204 pool-8-thread-1 system 5 WAITING 0 0:0 false false
Threads Total: 16, NEW: 0, RUNNABLE: 9, BLOCKED: 0, WAITING: 3, TIMED_WAITING: 4, TERMINATED: 0
ID NAME GROUP PRIORITY STATE %CPU DELTA_TIME TIME INTERRUPTE DAEMON
3 Finalizer system 8 WAITING 0.0 0.000 0:0.000 false true
20 arthas-UserStat system 9 WAITING 0.0 0.000 0:0.001 false true
14 arthas-timer system 9 WAITING 0.0 0.000 0:0.000 false true
```
Binary file not shown.

Before

Width:  |  Height:  |  Size: 976 KiB

After

Width:  |  Height:  |  Size: 791 KiB

+1 -1
View File
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '3.4.1',
VERSION: '3.4.2',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Advanced Usage &mdash; Arthas 3.4.1 documentation</title>
<title>Advanced Usage &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fundamental Fields in Expressions &mdash; Arthas 3.4.1 documentation</title>
<title>Fundamental Fields in Expressions &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Start as a Java Agent &mdash; Arthas 3.4.1 documentation</title>
<title>Start as a Java Agent &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Arthas Properties &mdash; Arthas 3.4.1 documentation</title>
<title>Arthas Properties &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Arthas Async Jobs &mdash; Arthas 3.4.1 documentation</title>
<title>Arthas Async Jobs &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Batch Processing &mdash; Arthas 3.4.1 documentation</title>
<title>Batch Processing &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>cat &mdash; Arthas 3.4.1 documentation</title>
<title>cat &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>classloader &mdash; Arthas 3.4.1 documentation</title>
<title>classloader &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>All Commands &mdash; Arthas 3.4.1 documentation</title>
<title>All Commands &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact Us &mdash; Arthas 3.4.1 documentation</title>
<title>Contact Us &mdash; Arthas 3.4.2 documentation</title>
@@ -72,7 +72,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+59 -38
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>dashboard &mdash; Arthas 3.4.1 documentation</title>
<title>dashboard &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
@@ -108,7 +108,10 @@
<li class="toctree-l2 current"><a class="current reference internal" href="#">dashboard</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#options">Options</a></li>
<li class="toctree-l3"><a class="reference internal" href="#usage">Usage</a></li>
<li class="toctree-l3"><a class="reference internal" href="#notes-on-column-headers">Notes on column headers</a></li>
<li class="toctree-l3"><a class="reference internal" href="#notes-on-column-headers">Notes on column headers</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#jvm-internal-threads">JVM internal threads</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#screenshot">Screenshot</a></li>
</ul>
</li>
@@ -254,39 +257,37 @@
<div class="section" id="usage">
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h2>
<div class="highlight-default notranslate"><pre class="literal-block">$ dashboard
ID NAME GROUP PRIORITY STATE %CPU TIME INTERRUPTED DAEMON
889 RMI TCP Connection(15)-30.10.166. RMI Runtime 9 RUNNABLE 48 0:5 false true
1077 Timer-for-arthas-dashboard-0 system 9 RUNNABLE 24 0:0 false true
1074 as-selector-daemon system 9 RUNNABLE 12 0:0 false true
284 JMX server connection timeout 284 RMI Runtime 9 TIMED_WAITI 8 0:3 false true
16 Timer-1 main 5 TIMED_WAITI 5 0:9 false true
47 Pandora pandora-qos-reporter Pool main 5 TIMED_WAITI 0 0:0 false true
48 JmonitorClient-CheckThread Pool [ main 5 TIMED_WAITI 0 0:0 false true
49 JmonitorClient-HeartBeat Pool [Th main 5 TIMED_WAITI 0 0:0 false true
50 JmonitorClient-ReaderThread Pool main 5 TIMED_WAITI 0 0:0 false true
957 RMI TCP Connection(16)-30.10.166. RMI Runtime 9 RUNNABLE 0 0:2 false true
51 JmonitorClient-WriterThread Pool main 5 TIMED_WAITI 0 0:0 false true
52 ContainerBackgroundProcessor[Stan main 5 TIMED_WAITI 0 0:0 false true
53 http-bio-8080-Acceptor-0 main 5 RUNNABLE 0 0:2 false true
54 http-bio-8080-AsyncTimeout main 5 TIMED_WAITI 0 0:0 false true
11 GC Daemon system 2 TIMED_WAITI 0 0:0 false true
Memory used total max usage GC
heap 59M 223M 1820M 3.26% gc.ps_scavenge.count 118
ps_eden_space 14M 114M 668M 2.11% gc.ps_scavenge.time(ms) 1890
ps_survivor_space 6M 6M 6M 96.08% gc.ps_marksweep.count 5
ps_old_gen 39M 103M 1365M 2.86% gc.ps_marksweep.time(ms) 1140
nonheap 234M 240M 0M 97.46%
code_cache 46M 47M 240M 19.49%
metaspace 167M 172M 0M 97.36%
Runtime Tomcat
os.name Mac OS X connector http-bio-8080
os.version 10.10.5 QPS 0.00
java.version 1.8.0_60 RT(ms) 1.13
java.home error/s 0.00
received/s 0B
systemload.average 3.44 sent/s 0B
processors 4 threadpool http-bio-8080
uptime 16020s busy 0</pre>
ID NAME GROUP PRIORITY STATE %CPU DELTA_TIME TIME INTERRUPTE DAEMON
-1 C2 CompilerThread0 - -1 - 1.55 0.077 0:8.684 false true
53 Timer-for-arthas-dashboard-07b system 5 RUNNABLE 0.08 0.004 0:0.004 false true
22 scheduling-1 main 5 TIMED_WAI 0.06 0.003 0:0.287 false false
-1 C1 CompilerThread0 - -1 - 0.06 0.003 0:2.171 false true
-1 VM Periodic Task Thread - -1 - 0.03 0.001 0:0.092 false true
49 arthas-NettyHttpTelnetBootstra system 5 RUNNABLE 0.02 0.001 0:0.156 false true
16 Catalina-utility-1 main 1 TIMED_WAI 0.0 0.000 0:0.029 false false
-1 G1 Young RemSet Sampling - -1 - 0.0 0.000 0:0.019 false true
17 Catalina-utility-2 main 1 WAITING 0.0 0.000 0:0.025 false false
34 http-nio-8080-ClientPoller main 5 RUNNABLE 0.0 0.000 0:0.016 false true
23 http-nio-8080-BlockPoller main 5 RUNNABLE 0.0 0.000 0:0.011 false true
-1 VM Thread - -1 - 0.0 0.000 0:0.032 false true
-1 Service Thread - -1 - 0.0 0.000 0:0.006 false true
-1 GC Thread#5 - -1 - 0.0 0.000 0:0.043 false true
Memory used total max usage GC
heap 36M 70M 4096M 0.90% gc.g1_young_generation.count 12
g1_eden_space 6M 18M -1 33.33% 86
g1_old_gen 30M 50M 4096M 0.74% gc.g1_old_generation.count 0
g1_survivor_space 491K 2048K -1 24.01% gc.g1_old_generation.time(ms) 0
nonheap 66M 69M -1 96.56%
codeheap_&#x27;non-nmethods&#x27; 1M 2M 5M 22.39%
metaspace 46M 47M -1 98.01%
Runtime
os.name Mac OS X
os.version 10.15.4
java.version 15
java.home /Library/Java/JavaVirtualMachines/jdk-15.jdk/Contents/Home
systemload.average 10.68
processors 8
uptime 272s</pre>
</div>
</div>
<div class="section" id="notes-on-column-headers">
@@ -297,11 +298,31 @@ uptime 16020s busy
<li><p>GROUP: thread group name</p></li>
<li><p>PRIORITY: thread priority, ranged from 1 to 10. The greater number, the higher priority</p></li>
<li><p>STATE: thread state</p></li>
<li><p>CPU%: the ratio of CPU usage for the thread, sampled every 100ms</p></li>
<li><p>TIME: total running time in <code class="docutils literal notranslate"><span class="pre">minute:second</span></code> format</p></li>
<li><p>CPU%: the ratio of CPU usage for the thread. For example, the sampling interval is 1000ms, and the incremental cpu time
of a thread is 100ms, then the cpu usage rate=100/1000=10%</p></li>
<li><p>DELTA_TIME: incremental CPU time of thread running after the last sampling in <code class="docutils literal notranslate"><span class="pre">second</span></code> format</p></li>
<li><p>TIME: total CPU time of the thread in <code class="docutils literal notranslate"><span class="pre">minute:second</span></code> format</p></li>
<li><p>INTERRUPTED: the thread interruption state</p></li>
<li><p>DAEMON: daemon thread or not</p></li>
</ul>
<div class="section" id="jvm-internal-threads">
<h3>JVM internal threads<a class="headerlink" href="#jvm-internal-threads" title="Permalink to this headline"></a></h3>
<p>After Java 8, it is supported to obtain the CPU time of JVM internal threads. These threads only have the name and CPU time,
without ID and status information (display ID is -1).</p>
<p>JVM activities can be observed through internal threads, such as GC, JIT compilation, etc., to perceive the overall status of JVM.</p>
<ul class="simple">
<li><p>When the JVM heap/metaspace space is insufficient or OOM, it can be seen that the CPU usage of the GC threads is
significantly higher than other threads.</p></li>
<li><p>After executing commands such as <code class="docutils literal notranslate"><span class="pre">trace/watch/tt/redefine</span></code>, you can see that JIT threads activities become more frequent.
Because the JIT compilation data related to this class is cleared when the JVM hot update the class bytecode, it needs to be recompiled.</p></li>
</ul>
<p>JVM internal threads include the following:</p>
<ul class="simple">
<li><p>JIT compilation thread: such as <code class="docutils literal notranslate"><span class="pre">C1</span> <span class="pre">CompilerThread0</span></code>, <code class="docutils literal notranslate"><span class="pre">C2</span> <span class="pre">CompilerThread0</span></code></p></li>
<li><p>GC thread: such as <code class="docutils literal notranslate"><span class="pre">GC</span> <span class="pre">Thread0</span></code>, <code class="docutils literal notranslate"><span class="pre">G1</span> <span class="pre">Young</span> <span class="pre">RemSet</span> <span class="pre">Sampling</span></code></p></li>
<li><p>Other internal threads: such as<code class="docutils literal notranslate"><span class="pre">VM</span> <span class="pre">Periodic</span> <span class="pre">Task</span> <span class="pre">Thread</span></code>, <code class="docutils literal notranslate"><span class="pre">VM</span> <span class="pre">Thread</span></code>, <code class="docutils literal notranslate"><span class="pre">Service</span> <span class="pre">Thread</span></code></p></li>
</ul>
</div>
</div>
<div class="section" id="screenshot">
<h2>Screenshot<a class="headerlink" href="#screenshot" title="Permalink to this headline"></a></h2>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Docker &mdash; Arthas 3.4.1 documentation</title>
<title>Docker &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Download &mdash; Arthas 3.4.1 documentation</title>
<title>Download &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>dump &mdash; Arthas 3.4.1 documentation</title>
<title>dump &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>echo &mdash; Arthas 3.4.1 documentation</title>
<title>echo &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -9,7 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Index &mdash; Arthas 3.4.1 documentation</title>
<title>Index &mdash; Arthas 3.4.2 documentation</title>
@@ -72,7 +72,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>getstatic &mdash; Arthas 3.4.1 documentation</title>
<title>getstatic &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>grep &mdash; Arthas 3.4.1 documentation</title>
<title>grep &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>groovy &mdash; Arthas 3.4.1 documentation</title>
<title>groovy &mdash; Arthas 3.4.2 documentation</title>
@@ -71,7 +71,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>heapdump &mdash; Arthas 3.4.1 documentation</title>
<title>heapdump &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Http API &mdash; Arthas 3.4.1 documentation</title>
<title>Http API &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IDEA Plugin &mdash; Arthas 3.4.1 documentation</title>
<title>IDEA Plugin &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Arthas Documentation &mdash; Arthas 3.4.1 documentation</title>
<title>Arthas Documentation &mdash; Arthas 3.4.2 documentation</title>
@@ -72,7 +72,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Install Arthas &mdash; Arthas 3.4.1 documentation</title>
<title>Install Arthas &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jad &mdash; Arthas 3.4.1 documentation</title>
<title>jad &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jvm &mdash; Arthas 3.4.1 documentation</title>
<title>jvm &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Arthas Console Keymap &mdash; Arthas 3.4.1 documentation</title>
<title>Arthas Console Keymap &mdash; Arthas 3.4.2 documentation</title>
@@ -71,7 +71,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>logger &mdash; Arthas 3.4.1 documentation</title>
<title>logger &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Manually Install Arthas &mdash; Arthas 3.4.1 documentation</title>
<title>Manually Install Arthas &mdash; Arthas 3.4.2 documentation</title>
@@ -71,7 +71,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>mbean &mdash; Arthas 3.4.1 documentation</title>
<title>mbean &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>mc &mdash; Arthas 3.4.1 documentation</title>
<title>mc &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>monitor &mdash; Arthas 3.4.1 documentation</title>
<title>monitor &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
BIN
View File
Binary file not shown.
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ognl &mdash; Arthas 3.4.1 documentation</title>
<title>ognl &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>options &mdash; Arthas 3.4.1 documentation</title>
<title>options &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>perfcounter &mdash; Arthas 3.4.1 documentation</title>
<title>perfcounter &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>profiler &mdash; Arthas 3.4.1 documentation</title>
<title>profiler &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pwd &mdash; Arthas 3.4.1 documentation</title>
<title>pwd &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quick Start &mdash; Arthas 3.4.1 documentation</title>
<title>Quick Start &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>redefine &mdash; Arthas 3.4.1 documentation</title>
<title>redefine &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Release Notes &mdash; Arthas 3.4.1 documentation</title>
<title>Release Notes &mdash; Arthas 3.4.2 documentation</title>
@@ -71,7 +71,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>reset &mdash; Arthas 3.4.1 documentation</title>
<title>reset &mdash; Arthas 3.4.2 documentation</title>
@@ -71,7 +71,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Log command outputs &mdash; Arthas 3.4.1 documentation</title>
<title>Log command outputs &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>sc &mdash; Arthas 3.4.1 documentation</title>
<title>sc &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search &mdash; Arthas 3.4.1 documentation</title>
<title>Search &mdash; Arthas 3.4.2 documentation</title>
@@ -72,7 +72,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+1 -1
View File
@@ -1 +1 @@
Search.setIndex({docnames:["README","advanced-use","advice-class","agent","arthas-properties","async","batch-support","cat","classloader","commands","contact-us","dashboard","docker","download","dump","echo","getstatic","grep","groovy","heapdump","http-api","idea-plugin","index","install-detail","jad","jvm","keymap","logger","manual-install","mbean","mc","monitor","ognl","options","perfcounter","profiler","pwd","quick-start","redefine","release-notes","reset","save-log","sc","sm","spring-boot-starter","stack","start-arthas","sysenv","sysprop","tee","thread","trace","tt","vmoption","watch","web-console"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:56},filenames:["README.md","advanced-use.md","advice-class.md","agent.md","arthas-properties.md","async.md","batch-support.md","cat.md","classloader.md","commands.md","contact-us.md","dashboard.md","docker.md","download.md","dump.md","echo.md","getstatic.md","grep.md","groovy.md","heapdump.md","http-api.md","idea-plugin.md","index.md","install-detail.md","jad.md","jvm.md","keymap.md","logger.md","manual-install.md","mbean.md","mc.md","monitor.md","ognl.md","options.md","perfcounter.md","profiler.md","pwd.md","quick-start.md","redefine.md","release-notes.md","reset.md","save-log.md","sc.md","sm.md","spring-boot-starter.md","stack.md","start-arthas.md","sysenv.md","sysprop.md","tee.md","thread.md","trace.md","tt.md","vmoption.md","watch.md","web-console.md"],objects:{},objnames:{},objtypes:{},terms:{"001018m":51,"004539m":51,"004935m":51,"005198m":51,"005372m":51,"005428m":51,"005778m":51,"006405m":51,"006783m":51,"008747m":51,"010317m":51,"010473m":51,"011636m":51,"012257m":51,"012416m":37,"013777m":51,"01696m":54,"019768m":51,"023715m":51,"028624m":51,"030432m":51,"033735m":51,"0353m":54,"03752m":51,"039s":1,"045534m":51,"05447m":51,"059839m":51,"061462m":51,"068692m":40,"06941m":51,"076457m":51,"078946m":51,"084025m":51,"08a":42,"094064m":51,"0_132":[24,37],"0_162":37,"0_51":48,"0_60":[8,11],"0m0":1,"0x0":47,"0x19":47,"0x1f5":47,"0x34":47,"0x4b67cf4d":52,"100m":[11,50,51],"100mb":27,"103m":11,"105228m":51,"10m":51,"1102230246251565e":[16,32,54],"113929m":51,"114m":11,"120s":31,"123934m":51,"128518m":40,"1294m":51,"12m":37,"136007m":37,"1365m":[11,37],"14dad5dc":40,"14m":[11,37],"155m":37,"16020s":11,"167786m":51,"167m":11,"168897m":54,"172m":11,"178583m":51,"1820m":[11,37],"182813m":51,"185203m":37,"1b6d3586":8,"200m":54,"202c":20,"20m":37,"223m":11,"232606m":51,"232887m":51,"234537m":51,"234m":11,"23m":37,"240m":[11,37],"241735m":20,"256color":47,"25s":33,"276874m":51,"277392m":54,"280502m":54,"281s":1,"28ea5898":32,"29fafb28":50,"2a139a55":27,"2b085b5d":20,"2bdd9114":24,"2eaa1027":[16,54],"2gb":27,"301ec38b":32,"303498m":54,"311395m":37,"31a6493":50,"327a647b":[30,38],"32m":37,"357742m":51,"3648e874":5,"389634m":51,"39m":11,"3d4eac69":[8,14,16,24,37,42,45,51],"3fe55d741882":55,"407b":20,"409446m":51,"414993m":54,"41cf53f9":54,"42ac":47,"42d3":20,"43de":20,"45df64fc":18,"46m":11,"472067c7":32,"473f":5,"477882m":54,"47m":11,"48f4":55,"492551m":51,"4a00":55,"4b85612c":32,"4c0df5f8":24,"4de6":21,"4rel":27,"522b4":42,"522b408a":54,"530255m":54,"546aeec1":50,"549379m":51,"572s":1,"587833m":54,"58ef25a97948":21,"590102m":40,"59m":11,"5ae4e5fbab8b4e529ac404f260d4e2d1_1":20,"5b0e2d00":18,"5e69":5,"5level":27,"60bc264d":47,"617465m":51,"6367e55a78a2":55,"65m":37,"66350f69":[8,14,24,37,42],"668m":11,"672m":37,"6849794470754667710l":24,"68b31f0a":8,"6951a712":24,"69ba0f27":50,"69dcaba4":24,"6cd0b6f8":50,"6e51ad67":24,"6fafc4c2":24,"701b744f971e":20,"7127ee12":50,"715367m":37,"716391m":51,"725be470":50,"7f89660b079b":5,"7f9a81e8":32,"838077m":51,"849713m":51,"852594m":51,"85m":37,"883b":20,"8b39":20,"8ecb9cb7c7804d5d92e258b23d5245cc_1":20,"8f7f6ad7bc2d4cb5aa57a530927a95cc_2":20,"94766d3c":20,"955dbd1325334a84972b0f3ac19de4f7_2":20,"961441m":54,"969732m":37,"98aee3ccbefb":20,"9eed":5,"9fa3":21,"\u4e2d\u6587\u6587\u6863":22,"boolean":[2,16,32,54],"break":[18,20],"byte":[1,24,25,39],"case":[2,5,17,22,39],"catch":[37,38],"char":[24,26],"class":[0,2,9,12,14,16,18,20,22,24,25,27,30,31,32,33,39,42,43,44,45,48,52,54],"default":[1,3,4,6,11,14,17,18,20,24,26,27,29,31,32,33,35,39,40,41,42,43,45,46,47,50,51,52,53,54,55],"enum":16,"export":[12,34],"final":[2,6,24,37,50],"function":[20,33,37,38,51],"import":[22,24,37,44],"instanceof":52,"int":[24,37,38,42],"long":[16,20,24,27,32,45,51,54],"new":[20,24,35,37,38,50,51],"null":[2,5,8,14,20,27,32,37,54],"public":[2,8,18,24,37,38,42,43,44],"return":[0,1,2,18,20,22,31,32,36,37,38,43,52],"static":[1,16,18,24,32,37,38,39,42,44],"super":[8,24,42],"switch":[18,28,29,35],"throw":[2,18,24,37,38,39,51,52],"true":[2,4,11,12,20,24,27,33,37,38,41,42,48,50,51,52,53],"try":[0,1,12,20,22,28,37,38,50],"var":[6,19,47,48],"void":[2,18,24,37,38,44],"while":[14,1Line truncated
Search.setIndex({docnames:["README","advanced-use","advice-class","agent","arthas-properties","async","batch-support","cat","classloader","commands","contact-us","dashboard","docker","download","dump","echo","getstatic","grep","groovy","heapdump","http-api","idea-plugin","index","install-detail","jad","jvm","keymap","logger","manual-install","mbean","mc","monitor","ognl","options","perfcounter","profiler","pwd","quick-start","redefine","release-notes","reset","save-log","sc","sm","spring-boot-starter","stack","start-arthas","sysenv","sysprop","tee","thread","trace","tt","vmoption","watch","web-console"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:56},filenames:["README.md","advanced-use.md","advice-class.md","agent.md","arthas-properties.md","async.md","batch-support.md","cat.md","classloader.md","commands.md","contact-us.md","dashboard.md","docker.md","download.md","dump.md","echo.md","getstatic.md","grep.md","groovy.md","heapdump.md","http-api.md","idea-plugin.md","index.md","install-detail.md","jad.md","jvm.md","keymap.md","logger.md","manual-install.md","mbean.md","mc.md","monitor.md","ognl.md","options.md","perfcounter.md","profiler.md","pwd.md","quick-start.md","redefine.md","release-notes.md","reset.md","save-log.md","sc.md","sm.md","spring-boot-starter.md","stack.md","start-arthas.md","sysenv.md","sysprop.md","tee.md","thread.md","trace.md","tt.md","vmoption.md","watch.md","web-console.md"],objects:{},objnames:{},objtypes:{},terms:{"001018m":51,"004539m":51,"004935m":51,"005198m":51,"005372m":51,"005428m":51,"005778m":51,"006405m":51,"006783m":51,"008747m":51,"010317m":51,"010473m":51,"011636m":51,"012257m":51,"012416m":37,"013777m":51,"01696m":54,"019768m":51,"023715m":51,"028624m":51,"030432m":51,"033735m":51,"0353m":54,"03752m":51,"039s":1,"045534m":51,"05447m":51,"059839m":51,"061462m":51,"068692m":40,"06941m":51,"076457m":51,"078946m":51,"07b":11,"084025m":51,"08a":42,"094064m":51,"0_132":[24,37],"0_162":37,"0_51":48,"0_60":8,"0m0":1,"0ms":50,"0x0":47,"0x19":47,"0x1f5":47,"0x34":47,"0x4b67cf4d":52,"1000m":[11,50],"100m":[11,51],"100mb":27,"105228m":51,"10m":51,"1102230246251565e":[16,32,54],"113929m":51,"1170m":50,"120s":31,"123934m":51,"128518m":40,"1294m":51,"12m":37,"136007m":37,"1365m":37,"14dad5dc":40,"14m":37,"155m":37,"167786m":51,"168897m":54,"178583m":51,"1820m":37,"182813m":51,"185203m":37,"18m":11,"1b6d3586":8,"1ms":50,"200m":[50,54],"202c":20,"2048k":11,"20m":37,"232606m":51,"232887m":51,"234537m":51,"23m":37,"240m":37,"241735m":20,"256color":47,"25s":33,"272s":11,"276874m":51,"277392m":54,"280502m":54,"281s":1,"28ea5898":32,"29fafb28":50,"2a139a55":27,"2b085b5d":20,"2bdd9114":24,"2eaa1027":[16,54],"2gb":27,"301ec38b":32,"303498m":54,"30m":11,"311395m":37,"31a6493":50,"327a647b":[30,38],"32m":37,"357742m":51,"3648e874":5,"36m":11,"389634m":51,"3d4eac69":[8,14,16,24,37,42,45,51],"3fe55d741882":55,"3ms":50,"401m":50,"407b":20,"409446m":51,"4096m":11,"414993m":54,"41cf53f9":54,"42ac":47,"42d3":20,"43de":20,"45df64fc":18,"46m":11,"472067c7":32,"473f":5,"477882m":54,"47m":11,"48f4":55,"491k":11,"492551m":51,"4a00":55,"4b85612c":32,"4c0df5f8":24,"4de6":21,"4rel":27,"50m":11,"522b4":42,"522b408a":54,"530255m":54,"546aeec1":50,"549379m":51,"572s":1,"584m":50,"587833m":54,"58ef25a97948":21,"590102m":40,"5ae4e5fbab8b4e529ac404f260d4e2d1_1":20,"5b0e2d00":18,"5e69":5,"5level":27,"60bc264d":47,"617465m":51,"6367e55a78a2":55,"65m":37,"66350f69":[8,14,24,37,42],"66m":11,"672m":37,"6849794470754667710l":24,"68b31f0a":8,"6951a712":24,"69dcaba4":24,"69m":11,"6e51ad67":24,"6fafc4c2":24,"701b744f971e":20,"70m":11,"7127ee12":50,"715367m":37,"716391m":51,"725be470":50,"7f89660b079b":5,"7f9a81e8":32,"838077m":51,"849713m":51,"852594m":51,"85m":37,"883b":20,"8b39":20,"8ecb9cb7c7804d5d92e258b23d5245cc_1":20,"8f7f6ad7bc2d4cb5aa57a530927a95cc_2":20,"94766d3c":20,"955dbd1325334a84972b0f3ac19de4f7_2":20,"961441m":54,"969732m":37,"98aee3ccbefb":20,"9eed":5,"9fa3":21,"\u4e2d\u6587\u6587\u6863":22,"boolean":[2,16,32,54],"break":[18,20],"byte":[1,24,25,39],"case":[2,5,17,22,39],"catch":[37,38],"char":[24,26],"class":[0,2,9,11,12,14,16,18,20,22,24,25,27,30,31,32,33,39,42,43,44,45,48,52,54],"default":[1,3,4,6,11,14,17,18,20,24,26,27,29,31,32,33,35,39,40,41,42,43,45,46,47,50,51,52,53,54,55],"enum":16,"export":[12,34],"final":[2,6,24,37,50],"function":[20,33,37,38,51],"import":[22,24,37,44],"instanceof":52,"int":[24,37,38,42],"long":[16,20,24,27,32,45,50,51,54],"new":[20,24,35,37,38,50,51],"null":[2,5,8,14,20,27,32,37,54],"public":[2,8,18,24,37,38,42,43,44],"return":[0,1,2,18,20,22,31,32,36,37,38,43,52],"static":[1,16,18,24,32,37,38,39,42,44],"super":[8,24,42],"switch":[18,28,29,35],"throw":[2,18,24,37,38,39,51,52],"true":[2,4,11,12,20,24,27,33,37,38,41,42,48,50,51,52,53],"try":[0,1,12,20,22,28,37,38,50],"var":[6,19,47,Line truncated
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>sm &mdash; Arthas 3.4.1 documentation</title>
<title>sm &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Arthas Spring Boot Starter &mdash; Arthas 3.4.1 documentation</title>
<title>Arthas Spring Boot Starter &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>stack &mdash; Arthas 3.4.1 documentation</title>
<title>stack &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Start Arthas &mdash; Arthas 3.4.1 documentation</title>
<title>Start Arthas &mdash; Arthas 3.4.2 documentation</title>
@@ -71,7 +71,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>sysenv &mdash; Arthas 3.4.1 documentation</title>
<title>sysenv &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>sysprop &mdash; Arthas 3.4.1 documentation</title>
<title>sysprop &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>tee &mdash; Arthas 3.4.1 documentation</title>
<title>tee &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+91 -56
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>thread &mdash; Arthas 3.4.1 documentation</title>
<title>thread &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
@@ -108,9 +108,11 @@
<li class="toctree-l2"><a class="reference internal" href="dashboard.html">dashboard</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">thread</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#parameters">Parameters</a></li>
<li class="toctree-l3"><a class="reference internal" href="#how-the-cpu-ratios-are-calculated">How the CPU ratios are calculated?</a></li>
<li class="toctree-l3"><a class="reference internal" href="#usage">Usage</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#list-the-top-n-busiest-threads-with-detailed-stack-trace">List the top n busiest threads with detailed stack trace</a></li>
<li class="toctree-l4"><a class="reference internal" href="#list-all-threads-info-when-no-options-provided">List all threads’ info when no options provided</a></li>
<li class="toctree-l4"><a class="reference internal" href="#list-first-page-threads-info-when-no-options-provided">List first page threads’ info when no options provided</a></li>
<li class="toctree-l4"><a class="reference internal" href="#thread-all-show-all-matching-threads">thread –all, show all matching threads</a></li>
<li class="toctree-l4"><a class="reference internal" href="#thread-id-show-the-running-stack-for-the-target-thread">thread id, show the running stack for the target thread</a></li>
<li class="toctree-l4"><a class="reference internal" href="#thread-b-locate-the-thread-bocking-the-others">thread -b, locate the thread bocking the others</a></li>
<li class="toctree-l4"><a class="reference internal" href="#thread-i-specify-the-sampling-interval">thread -i, specify the sampling interval</a></li>
@@ -262,12 +264,31 @@
<td align="right">[i <code>&lt;value&gt;</code>]</td>
<td align="left">specify the interval to collect data to compute CPU ratios (ms)</td>
</tr>
<tr>
<td align="right">[--all]</td>
<td align="left">Show all matching threads</td>
</tr>
</tbody>
</table><blockquote>
<div><p>How the CPU ratios are calculated? <br/><br/>
CPU ratio for a given thread is the CPU time it takes divided by the total CPU time within a specified interval period. It is calculated in the following way: sample CPU times for all the thread by calling <code class="docutils literal notranslate"><span class="pre">java.lang.management.ThreadMXBean#getThreadCpuTime</span></code> first, then sleep for a period (the default value is 100ms, which can be specified by <code class="docutils literal notranslate"><span class="pre">-i</span></code>), then sample CPU times again. By this, we can get the time cost for this period for each thread, then come up with the ratio. <br/><br/>
Note: this operation consumes CPU time too (<code class="docutils literal notranslate"><span class="pre">getThreadCpuTime</span></code> is time-consuming), therefore it is possible to observe Arthas’s thread appears in the list. To avoid this, try to increase sample interval, for example: 5000 ms.<br/><br/>
If you’d like to check the CPU ratios from the very beginning of the Java process, <a class="reference external" href="https://github.com/oldratlee/useful-scripts/blob/master/docs/java.md#-show-busy-java-threads">show-busy-java-threads</a> can come to help.</p>
</table></div>
<div class="section" id="how-the-cpu-ratios-are-calculated">
<h2>How the CPU ratios are calculated?<a class="headerlink" href="#how-the-cpu-ratios-are-calculated" title="Permalink to this headline"></a></h2>
<p>The cpu ratios here is similar to the thread <code class="docutils literal notranslate"><span class="pre">%CPU</span></code> of the linux command <code class="docutils literal notranslate"><span class="pre">top</span> <span class="pre">-H</span> <span class="pre">-p</span> <span class="pre">&lt;pid&gt;</span></code>. During a sampling interval,
the ratio of the incremental cpu time of each thread in the current JVM to the sampling interval time.</p>
<blockquote>
<div><p>Working principle description:</p>
</div></blockquote>
<ul class="simple">
<li><p>Do the first sampling, get the CPU time of all threads ( by calling <code class="docutils literal notranslate"><span class="pre">java.lang.management.ThreadMXBean#getThreadCpuTime()</span></code> and
<code class="docutils literal notranslate"><span class="pre">sun.management.HotspotThreadMBean.getInternalThreadCpuTimes()</span></code> )</p></li>
<li><p>Sleep and wait for an interval (the default is 200ms, the interval can be specified by <code class="docutils literal notranslate"><span class="pre">-i</span></code>)</p></li>
<li><p>Do the second sampling, get the CPU time of all threads, compare the two sampling data, and calculate the incremental CPU time of each thread</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">Thread</span> <span class="pre">CPU</span> <span class="pre">usage</span> <span class="pre">ratio</span></code> = <code class="docutils literal notranslate"><span class="pre">Thread</span> <span class="pre">increment</span> <span class="pre">CPU</span> <span class="pre">time</span></code> / <code class="docutils literal notranslate"><span class="pre">Sampling</span> <span class="pre">interval</span> <span class="pre">time</span></code> * 100%</p></li>
</ul>
<blockquote>
<div><p>Note: this operation consumes CPU time too (<code class="docutils literal notranslate"><span class="pre">getThreadCpuTime</span></code> is time-consuming), therefore it is possible to observe Arthas’s thread appears in the list. To avoid this, try to increase sample interval, for example: 5000 ms.<br/></p>
</div></blockquote>
<blockquote>
<div><p>Another way to view the thread cpu usage of the Java process, <a class="reference external" href="https://github.com/oldratlee/useful-scripts/blob/master/docs/java.md#-show-busy-java-threads">show-busy-java-threads</a> can come to help.</p>
</div></blockquote>
</div>
<div class="section" id="usage">
@@ -275,54 +296,66 @@ If you’d like to check the CPU ratios from the very beginning of the Java proc
<div class="section" id="list-the-top-n-busiest-threads-with-detailed-stack-trace">
<h3>List the top n busiest threads with detailed stack trace<a class="headerlink" href="#list-the-top-n-busiest-threads-with-detailed-stack-trace" title="Permalink to this headline"></a></h3>
<div class="highlight-shell notranslate"><div class="highlight hljs"><pre class="shell">$ thread -n 3
&quot;as-command-execute-daemon&quot; Id=29 cpuUsage=75% RUNNABLE
at sun.management.ThreadImpl.dumpThreads0(Native Method)
at sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:440)
at com.taobao.arthas.core.command.monitor200.ThreadCommand$1.action(ThreadCommand.java:58)
at com.taobao.arthas.core.command.handler.AbstractCommandHandler.execute(AbstractCommandHandler.java:238)
at com.taobao.arthas.core.command.handler.DefaultCommandHandler.handleCommand(DefaultCommandHandler.java:67)
at com.taobao.arthas.core.server.ArthasServer$4.run(ArthasServer.java:276)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
&quot;C1 CompilerThread0&quot; [Internal] cpuUsage=1.63% deltaTime=3ms time=1170ms
Number of locked synchronizers = 1
- java.util.concurrent.ThreadPoolExecutor$Worker@6cd0b6f8
&quot;arthas-command-execute&quot; Id=23 cpuUsage=0.11% deltaTime=0ms time=401ms RUNNABLE
at java.management@11.0.7/sun.management.ThreadImpl.dumpThreads0(Native Method)
at java.management@11.0.7/sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:466)
at com.taobao.arthas.core.command.monitor200.ThreadCommand.processTopBusyThreads(ThreadCommand.java:199)
at com.taobao.arthas.core.command.monitor200.ThreadCommand.process(ThreadCommand.java:122)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.process(AnnotatedCommandImpl.java:82)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.access$100(AnnotatedCommandImpl.java:18)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:111)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:108)
at com.taobao.arthas.core.shell.system.impl.ProcessImpl$CommandProcessTask.run(ProcessImpl.java:385)
at java.base@11.0.7/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base@11.0.7/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base@11.0.7/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base@11.0.7/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base@11.0.7/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base@11.0.7/java.lang.Thread.run(Thread.java:834)
&quot;as-session-expire-daemon&quot; Id=25 cpuUsage=24% TIMED_WAITING
at java.lang.Thread.sleep(Native Method)
at com.taobao.arthas.core.server.DefaultSessionManager$2.run(DefaultSessionManager.java:85)
&quot;Reference Handler&quot; Id=2 cpuUsage=0% WAITING on java.lang.ref.Reference$Lock@69ba0f27
at java.lang.Object.wait(Native Method)
- waiting on java.lang.ref.Reference$Lock@69ba0f27
at java.lang.Object.wait(Object.java:503)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)</pre></div>
&quot;VM Periodic Task Thread&quot; [Internal] cpuUsage=0.07% deltaTime=0ms time=584ms</pre></div>
</div>
<ul class="simple">
<li><p>Without thread ID, including <code class="docutils literal notranslate"><span class="pre">[Internal]</span></code> means JVM internal thread, refer to the introduction of <a class="reference internal" href="dashboard.html"><span class="doc">dashboard</span></a> command.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cpuUsage</span></code> is the CPU usage of the thread during the sampling interval, consistent with the data of the <a class="reference internal" href="dashboard.html"><span class="doc">dashboard</span></a> command.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">deltaTime</span></code> is the incremental CPU time of the thread during the sampling interval. If it is less than 1ms, it will be rounded and displayed as 0ms.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">time</span></code> The total CPU time of thread.</p></li>
</ul>
<p><strong>Note:</strong> The thread stack is acquired at the end of the second sampling, which does not indicate that the thread is
processing the same task during the sampling interval. It is recommended that the interval time should not be too long.
The larger the interval time, the more inaccurate.</p>
<p>You can try to specify different intervals according to the specific situation and observe the output results.</p>
</div>
<div class="section" id="list-all-threads-info-when-no-options-provided">
<h3>List all threads’ info when no options provided<a class="headerlink" href="#list-all-threads-info-when-no-options-provided" title="Permalink to this headline"></a></h3>
<div class="section" id="list-first-page-threads-info-when-no-options-provided">
<h3>List first page threads’ info when no options provided<a class="headerlink" href="#list-first-page-threads-info-when-no-options-provided" title="Permalink to this headline"></a></h3>
<p>By default, they are arranged in descending order of CPU increment time, and only the first page of data is displayed.</p>
<div class="highlight-shell notranslate"><div class="highlight hljs"><pre class="shell">$ thread
Threads Total: 16, NEW: 0, RUNNABLE: 7, BLOCKED: 0, WAITING: 5, TIMED_WAITING: 4, TERMINATED: 0
ID NAME GROUP PRIORITY STATE %CPU TIME INTERRUPTE DAEMON
30 as-command-execute-daemon system 9 RUNNABLE 72 0:0 false true
23 as-session-expire-daemon system 9 TIMED_WAIT 27 0:0 false true
22 Attach Listener system 9 RUNNABLE 0 0:0 false true
11 pool-2-thread-1 main 5 TIMED_WAIT 0 0:0 false false
12 Thread-2 main 5 RUNNABLE 0 0:0 false true
13 pool-3-thread-1 main 5 TIMED_WAIT 0 0:0 false false
25 as-selector-daemon system 9 RUNNABLE 0 0:0 false true
14 Thread-3 main 5 TIMED_WAIT 0 0:0 false false
26 pool-5-thread-1 system 5 WAITING 0 0:0 false false
15 Thread-4 main 5 RUNNABLE 0 0:0 false false
1 main main 5 WAITING 0 0:2 false false
2 Reference Handler system 10 WAITING 0 0:0 false true
3 Finalizer system 8 WAITING 0 0:0 false true
4 Signal Dispatcher system 9 RUNNABLE 0 0:0 false true
20 NonBlockingInputStreamThread main 5 WAITING 0 0:0 false true
21 Thread-8 main 5 RUNNABLE 0 0:0 false true</pre></div>
Threads Total: 33, NEW: 0, RUNNABLE: 9, BLOCKED: 0, WAITING: 3, TIMED_WAITING: 4, TERMINATED: 0, Internal threads: 17
ID NAME GROUP PRIORITY STATE %CPU DELTA_TIME TIME INTERRUPT DAEMON
-1 C2 CompilerThread0 - -1 - 5.06 0.010 0:0.973 false true
-1 C1 CompilerThread0 - -1 - 0.95 0.001 0:0.603 false true
23 arthas-command-execute system 5 RUNNABLE 0.17 0.000 0:0.226 false true
-1 VM Periodic Task Thread - -1 - 0.05 0.000 0:0.094 false true
-1 Sweeper thread - -1 - 0.04 0.000 0:0.011 false true
-1 G1 Young RemSet Sampling - -1 - 0.02 0.000 0:0.025 false true
12 Attach Listener system 9 RUNNABLE 0.0 0.000 0:0.022 false true
11 Common-Cleaner InnocuousThrea 8 TIMED_WAI 0.0 0.000 0:0.000 false true
3 Finalizer system 8 WAITING 0.0 0.000 0:0.000 false true
2 Reference Handler system 10 RUNNABLE 0.0 0.000 0:0.000 false true
4 Signal Dispatcher system 9 RUNNABLE 0.0 0.000 0:0.000 false true
15 arthas-NettyHttpTelnetBootstra system 5 RUNNABLE 0.0 0.000 0:0.029 false true
22 arthas-NettyHttpTelnetBootstra system 5 RUNNABLE 0.0 0.000 0:0.196 false true
24 arthas-NettyHttpTelnetBootstra system 5 RUNNABLE 0.0 0.000 0:0.038 false true
16 arthas-NettyWebsocketTtyBootst system 5 RUNNABLE 0.0 0.000 0:0.001 false true
17 arthas-NettyWebsocketTtyBootst system 5 RUNNABLE 0.0 0.000 0:0.001 false true</pre></div>
</div>
</div>
<div class="section" id="thread-all-show-all-matching-threads">
<h3>thread –all, show all matching threads<a class="headerlink" href="#thread-all-show-all-matching-threads" title="Permalink to this headline"></a></h3>
<p>Display all matching threads. Sometimes it is necessary to obtain all the thread data of the JVM for analysis.</p>
</div>
<div class="section" id="thread-id-show-the-running-stack-for-the-target-thread">
<h3>thread id, show the running stack for the target thread<a class="headerlink" href="#thread-id-show-the-running-stack-for-the-target-thread" title="Permalink to this headline"></a></h3>
<div class="highlight-shell notranslate"><div class="highlight hljs"><pre class="shell">$ thread 1
@@ -382,6 +415,10 @@ ID NAME GROUP PRIORITY STA
</div>
<div class="section" id="thread-i-specify-the-sampling-interval">
<h3>thread -i, specify the sampling interval<a class="headerlink" href="#thread-i-specify-the-sampling-interval" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">thread</span> <span class="pre">-i</span> <span class="pre">1000</span></code>: Count the thread cpu time of the last 1000ms.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">thread</span> <span class="pre">-n</span> <span class="pre">3</span> <span class="pre">-i</span> <span class="pre">1000</span></code>: List the 3 busiest thread stacks in 1000ms</p></li>
</ul>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ thread -n 3 -i 1000
&quot;as-command-execute-daemon&quot; Id=4759 cpuUsage=23% RUNNABLE
at sun.management.ThreadImpl.dumpThreads0(Native Method)
@@ -405,13 +442,11 @@ ID NAME GROUP PRIORITY STA
<div class="section" id="thread-state-view-the-special-state-theads">
<h3>thread –state , view the special state theads<a class="headerlink" href="#thread-state-view-the-special-state-theads" title="Permalink to this headline"></a></h3>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">[arthas@28114]$ thread --state WAITING
Threads Total: 15, NEW: 0, RUNNABLE: 7, BLOCKED: 0, WAITING: 5, TIMED_WAITING: 3, TERMINATED: 0
ID NAME GROUP PRIORITY STATE %CPU TIME INTERRU DAEMON
198 AsyncAppender-Worker-arth system 9 WAITING 0 0:0 false true
3 Finalizer system 8 WAITING 0 0:0 false true
14 RMI Scheduler(0) system 9 WAITING 0 0:0 false true
2 Reference Handler system 10 WAITING 0 0:0 false true
204 pool-8-thread-1 system 5 WAITING 0 0:0 false false</pre></div>
Threads Total: 16, NEW: 0, RUNNABLE: 9, BLOCKED: 0, WAITING: 3, TIMED_WAITING: 4, TERMINATED: 0
ID NAME GROUP PRIORITY STATE %CPU DELTA_TIME TIME INTERRUPTE DAEMON
3 Finalizer system 8 WAITING 0.0 0.000 0:0.000 false true
20 arthas-UserStat system 9 WAITING 0.0 0.000 0:0.001 false true
14 arthas-timer system 9 WAITING 0.0 0.000 0:0.000 false true</pre></div>
</div>
</div>
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>trace &mdash; Arthas 3.4.1 documentation</title>
<title>trace &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>tt &mdash; Arthas 3.4.1 documentation</title>
<title>tt &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vmoption &mdash; Arthas 3.4.1 documentation</title>
<title>vmoption &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>watch &mdash; Arthas 3.4.1 documentation</title>
<title>watch &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>
+2 -2
View File
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Web Console &mdash; Arthas 3.4.1 documentation</title>
<title>Web Console &mdash; Arthas 3.4.2 documentation</title>
@@ -73,7 +73,7 @@
<div class="version">
3.4.1
3.4.2
</div>