|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
<!--[if IE 8]><html class="no-js lt-ie9" lang="zh-CN" > <![endif]-->
|
|
|
<!--[if gt IE 8]><!--> <html class="no-js" lang="zh-CN" > <!--<![endif]-->
|
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
|
<title>thread — Arthas 3.1.2 文档</title>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="shortcut icon" href="_static/favicon.ico"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
|
|
|
|
|
|
|
|
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
|
|
<script type="text/javascript" src="_static/jquery.js"></script>
|
|
|
<script type="text/javascript" src="_static/underscore.js"></script>
|
|
|
<script type="text/javascript" src="_static/doctools.js"></script>
|
|
|
<script type="text/javascript" src="_static/language_data.js"></script>
|
|
|
<script type="text/javascript" src="_static/translations.js"></script>
|
|
|
|
|
|
<script type="text/javascript" src="_static/js/theme.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
|
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
|
|
<link rel="stylesheet" href="_static/overrides.css" type="text/css" />
|
|
|
<link rel="index" title="索引" href="genindex.html" />
|
|
|
<link rel="search" title="搜索" href="search.html" />
|
|
|
<link rel="next" title="jvm" href="jvm.html" />
|
|
|
<link rel="prev" title="dashboard" href="dashboard.html" />
|
|
|
<script src="_static/center_page.js"></script>
|
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/github.min.css">
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
|
<body class="wy-body-for-nav">
|
|
|
|
|
|
|
|
|
<div class="wy-grid-for-nav">
|
|
|
|
|
|
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
|
<div class="wy-side-scroll">
|
|
|
<div class="wy-side-nav-search" >
|
|
|
|
|
|
|
|
|
|
|
|
<a href="index.html" class="icon icon-home"> Arthas
|
|
|
|
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="version">
|
|
|
3.1.2
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div role="search">
|
|
|
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
|
|
|
<input type="text" name="q" placeholder="Search docs" />
|
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
|
<input type="hidden" name="area" value="default" />
|
|
|
</form>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ul class="current">
|
|
|
<li class="toctree-l1"><a class="reference external" href="https://alibaba.github.io/arthas/en/">English Docs</a></li>
|
|
|
<li class="toctree-l1"><a class="reference external" href="https://alibaba.github.io/arthas/arthas-tutorials?language=cn">在线教程(推荐)</a></li>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="install-detail.html">安装</a></li>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="download.html">下载</a></li>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="quick-start.html">快速入门</a></li>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="advanced-use.html">进阶使用</a></li>
|
|
|
<li class="toctree-l1 current"><a class="reference internal" href="commands.html">命令列表</a><ul class="current">
|
|
|
<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="#id1">参数说明</a></li>
|
|
|
<li class="toctree-l3"><a class="reference internal" href="#id2">使用参考</a><ul>
|
|
|
<li class="toctree-l4"><a class="reference internal" href="#n">支持一键展示当前最忙的前N个线程并打印堆栈:</a></li>
|
|
|
<li class="toctree-l4"><a class="reference internal" href="#id3">当没有参数时,显示所有线程的信息。</a></li>
|
|
|
<li class="toctree-l4"><a class="reference internal" href="#thread-id">thread id, 显示指定线程的运行堆栈</a></li>
|
|
|
<li class="toctree-l4"><a class="reference internal" href="#thread-b">thread -b, 找出当前阻塞其他线程的线程</a></li>
|
|
|
<li class="toctree-l4"><a class="reference internal" href="#thread-i">thread -i, 指定采样时间间隔</a></li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="jvm.html">jvm</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="sysprop.html">sysprop</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="sysenv.html">sysenv</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="vmoption.html">vmoption</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="logger.html">logger</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="mbean.html">mbean</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="getstatic.html">getstatic</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="ognl.html">ognl</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="sc.html">sc</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="sm.html">sm</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="dump.html">dump</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="heapdump.html">heapdump</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="jad.html">jad</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="classloader.html">classloader</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="mc.html">mc</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="redefine.html">redefine</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="monitor.html">monitor</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="watch.html">watch</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="trace.html">trace</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="stack.html">stack</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="tt.html">tt</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="cat.html">cat</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="pwd.html">pwd</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="options.html">options</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="commands.html#arthas">Arthas 基础命令</a></li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="web-console.html">WebConsole</a></li>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="docker.html">Docker</a></li>
|
|
|
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/issues?q=label%3Auser-case">用户案例</a></li>
|
|
|
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/issues?q=label%3Aquestion-answered">常见问题</a></li>
|
|
|
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas">Fork me at GitHub</a></li>
|
|
|
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/blob/master/CONTRIBUTING">编译调试/参与贡献</a></li>
|
|
|
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/releases">Release Notes</a></li>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="contact-us.html">QQ群/钉钉群</a></li>
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
</nav>
|
|
|
|
|
|
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
|
|
|
|
|
|
|
<nav class="wy-nav-top" aria-label="top navigation">
|
|
|
|
|
|
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
|
<a href="index.html">Arthas</a>
|
|
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
<div class="wy-nav-content">
|
|
|
|
|
|
<div class="rst-content">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
|
|
|
|
<ul class="wy-breadcrumbs">
|
|
|
|
|
|
<li><a href="index.html">Docs</a> »</li>
|
|
|
|
|
|
<li><a href="commands.html">命令列表</a> »</li>
|
|
|
|
|
|
<li>thread</li>
|
|
|
|
|
|
|
|
|
<li class="wy-breadcrumbs-aside">
|
|
|
|
|
|
|
|
|
|
|
|
<a href="https://github.com/alibaba/arthas/blob/master/site/src/site/sphinx/thread.md" class="fa fa-github"> Edit on GitHub</a>
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
<hr/>
|
|
|
</div>
|
|
|
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
|
<div itemprop="articleBody">
|
|
|
|
|
|
<div class="section" id="thread">
|
|
|
<h1>thread<a class="headerlink" href="#thread" title="永久链接至标题">¶</a></h1>
|
|
|
<blockquote>
|
|
|
<div><p>查看当前线程信息,查看线程的堆栈</p>
|
|
|
</div></blockquote>
|
|
|
<div class="section" id="id1">
|
|
|
<h2>参数说明<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h2>
|
|
|
<table border="1" class="docutils">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<th align="right">参数名称</th>
|
|
|
<th align="left">参数说明</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
<tr>
|
|
|
<td align="right"><em>id</em></td>
|
|
|
<td align="left">线程id</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td align="right">[n:]</td>
|
|
|
<td align="left">指定最忙的前N个线程并打印堆栈</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td align="right">[b]</td>
|
|
|
<td align="left">找出当前阻塞其他线程的线程</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td align="right">[i <code><value></code>]</td>
|
|
|
<td align="left">指定cpu占比统计的采样间隔,单位为毫秒</td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table><blockquote>
|
|
|
<div><p>cpu占比是如何统计出来的?</p>
|
|
|
</div></blockquote>
|
|
|
<blockquote>
|
|
|
<div><p>这里的cpu统计的是,一段采样间隔内,当前JVM里各个线程所占用的cpu时间占总cpu时间的百分比。其计算方法为:
|
|
|
首先进行一次采样,获得所有线程的cpu的使用时间(调用的是<code class="docutils literal notranslate"><span class="pre">java.lang.management.ThreadMXBean#getThreadCpuTime</span></code>这个接口),然后睡眠一段时间,默认100ms,可以通过<code class="docutils literal notranslate"><span class="pre">-i</span></code>参数指定,然后再采样一次,最后得出这段时间内各个线程消耗的cpu时间情况,最后算出百分比。</p>
|
|
|
</div></blockquote>
|
|
|
<blockquote>
|
|
|
<div><p>注意: 这个统计也会产生一定的开销(JDK这个接口本身开销比较大),因此会看到as的线程占用一定的百分比,为了降低统计自身的开销带来的影响,可以把采样间隔拉长一些,比如5000毫秒。</p>
|
|
|
</div></blockquote>
|
|
|
<blockquote>
|
|
|
<div><p>如果想看从Java进程启动开始到现在的cpu占比情况:可以使用<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>这个脚本</p>
|
|
|
</div></blockquote>
|
|
|
</div>
|
|
|
<div class="section" id="id2">
|
|
|
<h2>使用参考<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h2>
|
|
|
<div class="section" id="n">
|
|
|
<h3>支持一键展示当前最忙的前N个线程并打印堆栈:<a class="headerlink" href="#n" title="永久链接至标题">¶</a></h3>
|
|
|
<div class="highlight-shell notranslate"><div class="highlight hljs"><pre class="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
|
|
|
|
|
|
"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)
|
|
|
|
|
|
"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)</pre></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="section" id="id3">
|
|
|
<h3>当没有参数时,显示所有线程的信息。<a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h3>
|
|
|
<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>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="section" id="thread-id">
|
|
|
<h3>thread id, 显示指定线程的运行堆栈<a class="headerlink" href="#thread-id" title="永久链接至标题">¶</a></h3>
|
|
|
<div class="highlight-shell notranslate"><div class="highlight hljs"><pre class="shell">$ thread 1
|
|
|
"main" Id=1 WAITING on java.util.concurrent.CountDownLatch$Sync@29fafb28
|
|
|
at sun.misc.Unsafe.park(Native Method)
|
|
|
- waiting on java.util.concurrent.CountDownLatch$Sync@29fafb28
|
|
|
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
|
|
|
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)
|
|
|
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:997)
|
|
|
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1304)
|
|
|
at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:231)</pre></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="section" id="thread-b">
|
|
|
<h3>thread -b, 找出当前阻塞其他线程的线程<a class="headerlink" href="#thread-b" title="永久链接至标题">¶</a></h3>
|
|
|
<p>有时候我们发现应用卡住了, 通常是由于某个线程拿住了某个锁, 并且其他线程都在等待这把锁造成的。 为了排查这类问题, arthas提供了<code class="docutils literal notranslate"><span class="pre">thread</span> <span class="pre">-b</span></code>, 一键找出那个罪魁祸首。</p>
|
|
|
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ thread -b
|
|
|
"http-bio-8080-exec-4" Id=27 TIMED_WAITING
|
|
|
at java.lang.Thread.sleep(Native Method)
|
|
|
at test.arthas.TestThreadBlocking.doGet(TestThreadBlocking.java:22)
|
|
|
- locked java.lang.Object@725be470 <---- but blocks 4 other threads!
|
|
|
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
|
|
|
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
|
|
|
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
|
|
|
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
|
|
|
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
|
|
|
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
|
|
|
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
|
|
|
at test.filter.TestDurexFilter.doFilter(TestDurexFilter.java:46)
|
|
|
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
|
|
|
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
|
|
|
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
|
|
|
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
|
|
|
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
|
|
|
at com.taobao.tomcat.valves.ContextLoadFilterValve$FilterChainAdapter.doFilter(ContextLoadFilterValve.java:191)
|
|
|
at com.taobao.eagleeye.EagleEyeFilter.doFilter(EagleEyeFilter.java:81)
|
|
|
at com.taobao.tomcat.valves.ContextLoadFilterValve.invoke(ContextLoadFilterValve.java:150)
|
|
|
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
|
|
|
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
|
|
|
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
|
|
|
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:429)
|
|
|
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085)
|
|
|
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
|
|
|
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
|
|
|
- locked org.apache.tomcat.util.net.SocketWrapper@7127ee12
|
|
|
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
|
|
|
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
|
|
|
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
|
|
|
at java.lang.Thread.run(Thread.java:745)
|
|
|
|
|
|
Number of locked synchronizers = 1
|
|
|
- java.util.concurrent.ThreadPoolExecutor$Worker@31a6493e</pre></div>
|
|
|
</div>
|
|
|
<blockquote>
|
|
|
<div><p>注意, 目前只支持找出synchronized关键字阻塞住的线程, 如果是<code class="docutils literal notranslate"><span class="pre">java.util.concurrent.Lock</span></code>, 目前还不支持。</p>
|
|
|
</div></blockquote>
|
|
|
</div>
|
|
|
<div class="section" id="thread-i">
|
|
|
<h3>thread -i, 指定采样时间间隔<a class="headerlink" href="#thread-i" title="永久链接至标题">¶</a></h3>
|
|
|
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ thread -n 3 -i 1000
|
|
|
"as-command-execute-daemon" Id=4759 cpuUsage=23% RUNNABLE
|
|
|
at sun.management.ThreadImpl.dumpThreads0(Native Method)
|
|
|
at sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:440)
|
|
|
at com.taobao.arthas.core.command.monitor200.ThreadCommand.processTopBusyThreads(ThreadCommand.java:133)
|
|
|
at com.taobao.arthas.core.command.monitor200.ThreadCommand.process(ThreadCommand.java:79)
|
|
|
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.process(AnnotatedCommandImpl.java:96)
|
|
|
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.access$100(AnnotatedCommandImpl.java:27)
|
|
|
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:125)
|
|
|
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:122)
|
|
|
at com.taobao.arthas.core.shell.system.impl.ProcessImpl$CommandProcessTask.run(ProcessImpl.java:332)
|
|
|
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
|
|
|
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
|
|
|
at java.lang.Thread.run(Thread.java:756)
|
|
|
|
|
|
Number of locked synchronizers = 1
|
|
|
- java.util.concurrent.ThreadPoolExecutor$Worker@546aeec1
|
|
|
...</pre></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
<footer>
|
|
|
|
|
|
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
|
|
|
|
<a href="jvm.html" class="btn btn-neutral float-right" title="jvm" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
|
|
|
|
|
|
|
|
<a href="dashboard.html" class="btn btn-neutral float-left" title="dashboard" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<hr/>
|
|
|
|
|
|
<div role="contentinfo">
|
|
|
<p>
|
|
|
© Copyright 2018-2019, Alibaba Middleware Group, and contributors
|
|
|
|
|
|
</p>
|
|
|
</div>
|
|
|
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
|
|
|
|
</footer>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
</section>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
jQuery(function () {
|
|
|
SphinxRtdTheme.Navigation.enable(true);
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="github-fork-ribbon-wrapper right">
|
|
|
<div class="github-fork-ribbon">
|
|
|
<a href="https://github.com/alibaba/arthas" target="_blank">Fork me at GitHub</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript" src="_static/add_badges.js"></script>
|
|
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js"></script>
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.5.0/highlightjs-line-numbers.min.js"></script>
|
|
|
<script>
|
|
|
document.querySelectorAll('div.hljs > pre').forEach(function(block) {
|
|
|
hljs.highlightBlock(block);
|
|
|
hljs.lineNumbersBlock(block);
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
<script>
|
|
|
var _hmt = _hmt || [];
|
|
|
(function() {
|
|
|
var hm = document.createElement("script");
|
|
|
hm.src = "https://hm.baidu.com/hm.js?d5c5e25b100f0eb51a4c35c8a86ea9b4";
|
|
|
var s = document.getElementsByTagName("script")[0];
|
|
|
s.parentNode.insertBefore(hm, s);
|
|
|
})();
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
</html> |