update doc

gh-pages
hengyunabc 4 years ago
parent d535f0c16e
commit 3b6c127a34

@ -98,7 +98,6 @@
<ul>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

@ -111,18 +111,18 @@ Arthas支持使用管道对上述命令的结果进行进一步的处理如`s
正常情况下,每次执行`as.sh`/`arthas-boot.jar`需要选择或者指定PID。这样会比较麻烦因为每次启动应用它的PID会变化。
比如,已经启动了`arthas-demo.jar`,使用`jps`命令查看:
比如,已经启动了`math-game.jar`,使用`jps`命令查看:
```bash
$ jps
58883 arthas-demo.jar
58883 math-game.jar
58884 Jps
```
通过`select`参数可以指定进程名字,非常方便。
```bash
$ ./as.sh --select arthas-demo
$ ./as.sh --select math-game
Arthas script version: 3.3.6
[INFO] JAVA_HOME: /tmp/java/8.0.222-zulu
Arthas home: /Users/admin/.arthas/lib/3.3.6/arthas

@ -6,7 +6,7 @@
比如下载全量的arthas zip包解压之后以 `-javaagent` 的参数指定`arthas-agent.jar`来启动:
```
java -javaagent:/tmp/test/arthas-agent.jar -jar arthas-demo.jar
java -javaagent:/tmp/test/arthas-agent.jar -jar math-game.jar
```
默认的配置项在解压目录里的`arthas.properties`文件里。参考:[Arthas Properties](arthas-properties.md)

@ -64,7 +64,7 @@ Affect(row-cnt:4) cost in 3 ms.
```bash
$ classloader -c 3d4eac69
file:/private/tmp/arthas-demo.jar
file:/private/tmp/math-game.jar
file:/Users/hengyunabc/.arthas/lib/3.0.5/arthas/arthas-agent.jar
Affect(row-cnt:9) cost in 3 ms.
@ -76,7 +76,7 @@ Affect(row-cnt:9) cost in 3 ms.
```bash
$ classloader --classLoaderClass sun.misc.Launcher$AppClassLoader
file:/private/tmp/arthas-demo.jar
file:/private/tmp/math-game.jar
file:/Users/hengyunabc/.arthas/lib/3.0.5/arthas/arthas-agent.jar
Affect(row-cnt:9) cost in 3 ms.
@ -87,7 +87,7 @@ Affect(row-cnt:9) cost in 3 ms.
```bash
$ classloader -c 3d4eac69 -r META-INF/MANIFEST.MF
jar:file:/System/Library/Java/Extensions/MRJToolkit.jar!/META-INF/MANIFEST.MF
jar:file:/private/tmp/arthas-demo.jar!/META-INF/MANIFEST.MF
jar:file:/private/tmp/math-game.jar!/META-INF/MANIFEST.MF
jar:file:/Users/hengyunabc/.arthas/lib/3.0.5/arthas/arthas-agent.jar!/META-INF/MANIFEST.MF
```
@ -104,7 +104,7 @@ $ classloader -c 1b6d3586 -r java/lang/String.class
$ classloader -c 3d4eac69 --load demo.MathGame
load class success.
class-info demo.MathGame
code-source /private/tmp/arthas-demo.jar
code-source /private/tmp/math-game.jar
name demo.MathGame
isInterface false
isAnnotation false

@ -5,8 +5,6 @@
## 招聘
* [阿里云-云原生团队-2022 届春季实习⽣招聘](https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q)
* [期待你的加入](https://mp.weixin.qq.com/s/k5jozrSgmyH0tcQfrDkxUQ)
### Issues

@ -56,22 +56,22 @@ RUN export JAVA_HOME
## 通过Docker快速入门
1. 删除本地已有的`arthas-demo` docker container非必要
1. 删除本地已有的`math-game` docker container非必要
```sh
$ docker stop arthas-demo || true && docker rm arthas-demo || true
$ docker stop math-game || true && docker rm math-game || true
```
1. 启动`arthas-demo`
1. 启动`math-game`
```sh
$ docker run --name arthas-demo -it hengyunabc/arthas:latest /bin/sh -c "java -jar /opt/arthas/arthas-demo.jar"
$ docker run --name math-game -it hengyunabc/arthas:latest /bin/sh -c "java -jar /opt/arthas/math-game.jar"
```
1. 启动`arthas-boot`来进行诊断
```sh
$ docker exec -it arthas-demo /bin/sh -c "java -jar /opt/arthas/arthas-boot.jar"
$ docker exec -it math-game /bin/sh -c "java -jar /opt/arthas/arthas-boot.jar"
* [1]: 9 jar
[INFO] arthas home: /opt/arthas

@ -19,7 +19,7 @@ com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: ta
1. 检查当前用户和目标java进程是否一致。如果不一致则切换到同一用户。JVM只能attach同样用户下的java 进程。
2. 尝试使用 `jstack -l $pid`如果进程没有反应则说明进程可能假死无法响应JVM attach信号。所以同样基于attach机制的Arthas无法工作。尝试使用`jmap` heapdump后分析。
3. 尝试按[quick-start](quick-start.md)里的方式attach arthas-demo
3. 尝试按[quick-start](quick-start.md)里的方式attach math-game
4. 更多情况参考: [https://github.com/alibaba/arthas/issues/347](https://github.com/alibaba/arthas/issues/347)
##### trace/watch等命令能否增强jdk里的类
@ -56,7 +56,7 @@ options json-format true
可以使用 `-v` 查看观察匹配表达式的执行结果 [https://github.com/alibaba/arthas/issues/1348](https://github.com/alibaba/arthas/issues/1348)
例子[arthas-demo](quick-start.md)
例子[math-game](quick-start.md)
```bash
watch demo.MathGame primeFactors traceE '{params,returnObj,throwExp}' -v -n 5 -x 3 'params.length >0 && returnObj instanceof java.util.List'

@ -28,7 +28,6 @@ Contents
--------
* [首页](https://arthas.aliyun.com/)
* [2022实习生招聘!](https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q)
* [技术分享征文!](https://developer.aliyun.com/article/751641)
* [English Docs](https://arthas.aliyun.com/doc/en/)
* [在线教程(katacoda)](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn)

@ -93,7 +93,7 @@ ClassLoader:
+-sun.misc.Launcher$ExtClassLoader@7f31245a
Location:
/private/tmp/arthas-demo.jar
/private/tmp/math-game.jar
public static void main(String[] args) throws InterruptedException {
MathGame game = new MathGame();
@ -116,7 +116,7 @@ ClassLoader:
+-sun.misc.Launcher$ExtClassLoader@7f31245a
Location:
/private/tmp/arthas-demo.jar
/private/tmp/math-game.jar
public static void main(String[] args) throws InterruptedException {
MathGame game = new MathGame();

@ -1,16 +1,16 @@
快速入门
===
## 1. 启动Demo
## 1. 启动math-game
```bash
curl -O https://arthas.aliyun.com/arthas-demo.jar
java -jar arthas-demo.jar
curl -O https://arthas.aliyun.com/math-game.jar
java -jar math-game.jar
```
`arthas-demo`是一个简单的程序,每隔一秒生成一个随机数,再执行质因数分解,并打印出分解结果。
`math-game`是一个简单的程序,每隔一秒生成一个随机数,再执行质因数分解,并打印出分解结果。
`arthas-demo`源代码:[查看](https://github.com/alibaba/arthas/blob/master/demo/src/main/java/demo/MathGame.java)
`math-game`源代码:[查看](https://github.com/alibaba/arthas/blob/master/demo/src/main/java/demo/MathGame.java)
## 2. 启动arthas
@ -33,10 +33,10 @@ java -jar arthas-boot.jar
```bash
$ $ java -jar arthas-boot.jar
* [1]: 35542
[2]: 71560 arthas-demo.jar
[2]: 71560 math-game.jar
```
Demo进程是第2个则输入2再输入`回车/enter`。Arthas会attach到目标进程上并输出日志
`math-game`进程是第2个则输入2再输入`回车/enter`。Arthas会attach到目标进程上并输出日志
```bash
[INFO] Try to attach process 71560
@ -95,7 +95,7 @@ java.home /Library/Java/JavaVir
e/jre
```
## 4. 通过thread命令来获取到`arthas-demo`进程的Main Class
## 4. 通过thread命令来获取到`math-game`进程的Main Class
`thread 1`会打印线程ID 1的栈通常是main函数的线程。
@ -114,7 +114,7 @@ ClassLoader:
+-sun.misc.Launcher$ExtClassLoader@66350f69
Location:
/tmp/arthas-demo.jar
/tmp/math-game.jar
/*
* Decompiled with CFR 0_132.

@ -43,7 +43,7 @@ sc
```bash
$ sc -d demo.MathGame
class-info demo.MathGame
code-source /private/tmp/arthas-demo.jar
code-source /private/tmp/math-game.jar
name demo.MathGame
isInterface false
isAnnotation false
@ -71,7 +71,7 @@ sc
```bash
$ sc -d -f demo.MathGame
class-info demo.MathGame
code-source /private/tmp/arthas-demo.jar
code-source /private/tmp/math-game.jar
name demo.MathGame
isInterface false
isAnnotation false

@ -31,7 +31,7 @@ stack
#### 启动 Demo
启动[快速入门](quick-start.md)里的`arthas-demo`。
启动[快速入门](quick-start.md)里的`math-game`。
#### stack

@ -47,7 +47,7 @@ trace
#### 启动 Demo
启动[快速入门](quick-start.md)里的`arthas-demo`。
启动[快速入门](quick-start.md)里的`math-game`。
#### trace函数

@ -16,7 +16,7 @@ tt
#### 启动 Demo
启动[快速入门](quick-start.md)里的`arthas-demo`。
启动[快速入门](quick-start.md)里的`math-game`。
#### 记录调用

@ -42,7 +42,7 @@ watch 的参数比较多,主要是因为它能在 4 个不同的场景观察
#### 启动 Demo
启动[快速入门](quick-start.md)里的`arthas-demo`。
启动[快速入门](quick-start.md)里的`math-game`。
#### 观察方法出参和返回值

@ -520,15 +520,14 @@ dl.citation > dd:after {
}
dl.field-list {
display: grid;
grid-template-columns: fit-content(30%) auto;
display: flex;
flex-wrap: wrap;
}
dl.field-list > dt {
flex-basis: 20%;
font-weight: bold;
word-break: break-word;
padding-left: 0.5em;
padding-right: 5px;
}
dl.field-list > dt:after {
@ -536,8 +535,8 @@ dl.field-list > dt:after {
}
dl.field-list > dd {
padding-left: 0.5em;
margin-top: 0em;
flex-basis: 70%;
padding-left: 1em;
margin-left: 0em;
margin-bottom: 0em;
}

6
_static/jquery.js vendored

File diff suppressed because one or more lines are too long

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>
@ -354,13 +353,13 @@
<li><p>通过<code class="docutils literal notranslate"><span class="pre">select</span></code>功能选择attach的进程。</p></li>
</ul>
<p>正常情况下,每次执行<code class="docutils literal notranslate"><span class="pre">as.sh</span></code>/<code class="docutils literal notranslate"><span class="pre">arthas-boot.jar</span></code>需要选择或者指定PID。这样会比较麻烦因为每次启动应用它的PID会变化。</p>
<p>比如,已经启动了<code class="docutils literal notranslate"><span class="pre">arthas-demo.jar</span></code>,使用<code class="docutils literal notranslate"><span class="pre">jps</span></code>命令查看:</p>
<p>比如,已经启动了<code class="docutils literal notranslate"><span class="pre">math-game.jar</span></code>,使用<code class="docutils literal notranslate"><span class="pre">jps</span></code>命令查看:</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ jps
58883 arthas-demo.jar
58883 math-game.jar
58884 Jps</pre></div>
</div>
<p>通过<code class="docutils literal notranslate"><span class="pre">select</span></code>参数可以指定进程名字,非常方便。</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ ./as.sh --select arthas-demo
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ ./as.sh --select math-game
Arthas script version: 3.3.6
[INFO] JAVA_HOME: /tmp/java/8.0.222-zulu
Arthas home: /Users/admin/.arthas/lib/3.3.6/arthas

@ -98,7 +98,6 @@
<ul>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>
@ -214,7 +213,7 @@
<h1>以Java Agent的方式启动<a class="headerlink" href="#java-agent" title="永久链接至标题"></a></h1>
<p>通常Arthas是以动态attach的方式来诊断应用但从<code class="docutils literal notranslate"><span class="pre">3.2.0</span></code>版本起Arthas支持直接以 java agent的方式启动。</p>
<p>比如下载全量的arthas zip包解压之后以 <code class="docutils literal notranslate"><span class="pre">-javaagent</span></code> 的参数指定<code class="docutils literal notranslate"><span class="pre">arthas-agent.jar</span></code>来启动:</p>
<div class="highlight-default notranslate"><pre class="literal-block">java -javaagent:/tmp/test/arthas-agent.jar -jar arthas-demo.jar</pre>
<div class="highlight-default notranslate"><pre class="literal-block">java -javaagent:/tmp/test/arthas-agent.jar -jar math-game.jar</pre>
</div>
<p>默认的配置项在解压目录里的<code class="docutils literal notranslate"><span class="pre">arthas.properties</span></code>文件里。参考:<a class="reference internal" href="arthas-properties.html"><span class="doc">Arthas Properties</span></a></p>
<p>Java Agent机制参考 https://docs.oracle.com/javase/8/docs/api/java/lang/instrument/package-summary.html</p>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

@ -755,6 +755,18 @@
cn: "case-watch-method-exception-cn",
}
},
{
id: "case-ognl-practise",
type: "USERCASE",
names: {
en: "Debug ognl express",
cn: "调试ognl表达式",
},
ids: {
en: "case-ognl-practise-en",
cn: "case-ognl-practise-cn",
}
},
{
id: "case-thread",
type: "USERCASE",

@ -98,7 +98,6 @@
<ul>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

@ -98,7 +98,6 @@
<ul>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>
@ -289,7 +288,7 @@ trace test.arthas.TestTraceServlet doGet #cost&gt;800
<div class="section" id="id4">
<h3>自动高亮显示最耗时方法调用<a class="headerlink" href="#id4" title="永久链接至标题"></a></h3>
<p>trace命令现在会自动显示</p>
<p><img alt="image" src="arthas_3_0/TODO/image.png" /></p>
<p><img alt="arthas_3_0/TODO/image.png" src="arthas_3_0/TODO/image.png" />image</p>
</div>
<div class="section" id="id5">
<h3>带条件过滤的多级trace<a class="headerlink" href="#id5" title="永久链接至标题"></a></h3>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>
@ -325,7 +324,7 @@ Affect(row-cnt:4) cost in 3 ms.</pre></div>
<div class="section" id="urlclassloaderurls">
<h3>查看URLClassLoader实际的urls<a class="headerlink" href="#urlclassloaderurls" title="永久链接至标题"></a></h3>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ classloader -c 3d4eac69
file:/private/tmp/arthas-demo.jar
file:/private/tmp/math-game.jar
file:/Users/hengyunabc/.arthas/lib/3.0.5/arthas/arthas-agent.jar
Affect(row-cnt:9) cost in 3 ms.</pre></div>
@ -333,7 +332,7 @@ Affect(row-cnt:9) cost in 3 ms.</pre></div>
<p><em>注意</em> hashcode是变化的需要先查看当前的ClassLoader信息提取对应ClassLoader的hashcode。</p>
<p>对于只有唯一实例的ClassLoader可以通过class name指定使用起来更加方便</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ classloader --classLoaderClass sun.misc.Launcher$AppClassLoader
file:/private/tmp/arthas-demo.jar
file:/private/tmp/math-game.jar
file:/Users/hengyunabc/.arthas/lib/3.0.5/arthas/arthas-agent.jar
Affect(row-cnt:9) cost in 3 ms.</pre></div>
@ -343,7 +342,7 @@ Affect(row-cnt:9) cost in 3 ms.</pre></div>
<h3>使用ClassLoader去查找resource<a class="headerlink" href="#classloaderresource" title="永久链接至标题"></a></h3>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ classloader -c 3d4eac69 -r META-INF/MANIFEST.MF
jar:file:/System/Library/Java/Extensions/MRJToolkit.jar!/META-INF/MANIFEST.MF
jar:file:/private/tmp/arthas-demo.jar!/META-INF/MANIFEST.MF
jar:file:/private/tmp/math-game.jar!/META-INF/MANIFEST.MF
jar:file:/Users/hengyunabc/.arthas/lib/3.0.5/arthas/arthas-agent.jar!/META-INF/MANIFEST.MF</pre></div>
</div>
<p>也可以尝试查找类的class文件</p>
@ -356,7 +355,7 @@ Affect(row-cnt:9) cost in 3 ms.</pre></div>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ classloader -c 3d4eac69 --load demo.MathGame
load class success.
class-info demo.MathGame
code-source /private/tmp/arthas-demo.jar
code-source /private/tmp/math-game.jar
name demo.MathGame
isInterface false
isAnnotation false

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

@ -99,7 +99,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>
@ -122,7 +121,6 @@
<li class="toctree-l1"><a class="reference external" href="https://github.com/alibaba/arthas/releases">Release Notes</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">QQ群/钉钉群</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id2">招聘</a><ul>
<li class="toctree-l3"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">阿里云-云原生团队-2022 届春季实习⽣招聘</a></li>
<li class="toctree-l3"><a class="reference external" href="https://mp.weixin.qq.com/s/k5jozrSgmyH0tcQfrDkxUQ">期待你的加入</a></li>
<li class="toctree-l3"><a class="reference internal" href="#issues">Issues</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id3">钉钉群</a></li>
@ -203,7 +201,6 @@
<h2>招聘<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">阿里云-云原生团队-2022 届春季实习⽣招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/k5jozrSgmyH0tcQfrDkxUQ">期待你的加入</a></li>
</ul>
</div>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>
@ -331,7 +330,7 @@ uptime 272s</pre>
</div>
<div class="section" id="id4">
<h2>截图展示<a class="headerlink" href="#id4" title="永久链接至标题"></a></h2>
<p><img alt="_images/dashboard.png" src="_images/dashboard.png" /></p>
<p><img alt="dashboard" src="_images/dashboard.png" /></p>
</div>
</div>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>
@ -248,16 +247,16 @@ RUN export JAVA_HOME</pre></div>
<div class="section" id="id2">
<h2>通过Docker快速入门<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<ol>
<li><p>删除本地已有的<code class="docutils literal notranslate"><span class="pre">arthas-demo</span></code> docker container非必要</p>
<div class="highlight-sh notranslate"><div class="highlight hljs"><pre class="sh">$ docker stop arthas-demo || true &amp;&amp; docker rm arthas-demo || true</pre></div>
<li><p>删除本地已有的<code class="docutils literal notranslate"><span class="pre">math-game</span></code> docker container非必要</p>
<div class="highlight-sh notranslate"><div class="highlight hljs"><pre class="sh">$ docker stop math-game || true &amp;&amp; docker rm math-game || true</pre></div>
</div>
</li>
<li><p>启动<code class="docutils literal notranslate"><span class="pre">arthas-demo</span></code></p>
<div class="highlight-sh notranslate"><div class="highlight hljs"><pre class="sh">$ docker run --name arthas-demo -it hengyunabc/arthas:latest /bin/sh -c &quot;java -jar /opt/arthas/arthas-demo.jar&quot;</pre></div>
<li><p>启动<code class="docutils literal notranslate"><span class="pre">math-game</span></code></p>
<div class="highlight-sh notranslate"><div class="highlight hljs"><pre class="sh">$ docker run --name math-game -it hengyunabc/arthas:latest /bin/sh -c &quot;java -jar /opt/arthas/math-game.jar&quot;</pre></div>
</div>
</li>
<li><p>启动<code class="docutils literal notranslate"><span class="pre">arthas-boot</span></code>来进行诊断</p>
<div class="highlight-sh notranslate"><div class="highlight hljs"><pre class="sh">$ docker exec -it arthas-demo /bin/sh -c &quot;java -jar /opt/arthas/arthas-boot.jar&quot;
<div class="highlight-sh notranslate"><div class="highlight hljs"><pre class="sh">$ docker exec -it math-game /bin/sh -c &quot;java -jar /opt/arthas/arthas-boot.jar&quot;
* [1]: 9 jar
[INFO] arthas home: /opt/arthas

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>
@ -204,7 +203,7 @@
<h2>下载全量包<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<div class="section" id="maven">
<h3>从Maven仓库下载<a class="headerlink" href="#maven" title="永久链接至标题"></a></h3>
<p>最新版本,点击下载:<a class="reference external" href="https://arthas.aliyun.com/download/latest_version?mirror=aliyun"><img alt="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
<p>最新版本,点击下载:<a class="reference external" href="https://arthas.aliyun.com/download/latest_version?mirror=aliyun"><img alt="Arthas" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
</div>
<div class="section" id="github-releases">
<h3>从Github Releases页下载<a class="headerlink" href="#github-releases" title="永久链接至标题"></a></h3>
@ -231,7 +230,7 @@
</div>
<div class="section" id="id3">
<h2>下载离线文档<a class="headerlink" href="#id3" title="永久链接至标题"></a></h2>
<p>下载文档:<a class="reference external" href="https://arthas.aliyun.com/download/doc/latest_version?mirror=aliyun"><img alt="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
<p>下载文档:<a class="reference external" href="https://arthas.aliyun.com/download/doc/latest_version?mirror=aliyun"><img alt="Arthas" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
</div>
</div>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -107,18 +107,18 @@ Arthas supports living inside a browser. The communication between arthas and br
Normally, `as.sh`/`arthas-boot.jar` needs to a pid, bacause the pid will change.
For example, with `arthas-demo.jar` already started, use the `jps` command to see.
For example, with `math-game.jar` already started, use the `jps` command to see.
```bash
$ jps
58883 arthas-demo.jar
58883 math-game.jar
58884 Jps
```
The `select` option allows you to specify a process name, which is very convenient.
```bash
$ ./as.sh --select arthas-demo
$ ./as.sh --select math-game
Arthas script version: 3.3.6
[INFO] JAVA_HOME: /tmp/java/8.0.222-zulu
Arthas home: /Users/admin/.arthas/lib/3.3.6/arthas

@ -6,7 +6,7 @@ Usually Arthas dynamic attach the applications on the fly, but from version `3.2
For example, download the full arthas zip package, decompress it and start it by specifying `arthas-agent.jar` with the parameter `-javaagent`.
````
java -javaagent:/tmp/test/arthas-agent.jar -jar arthas-demo.jar
java -javaagent:/tmp/test/arthas-agent.jar -jar math-game.jar
````
The default configuration is in the `arthas.properties` file in the decompression directory. Reference: [Arthas Properties](arthas-properties.md)

@ -61,7 +61,7 @@ Affect(row-cnt:4) cost in 3 ms.
```bash
$ classloader -c 3d4eac69
file:/private/tmp/arthas-demo.jar
file:/private/tmp/math-game.jar
file:/Users/hengyunabc/.arthas/lib/3.0.5/arthas/arthas-agent.jar
Affect(row-cnt:9) cost in 3 ms.
@ -73,7 +73,7 @@ For ClassLoader with only unique instance, it can be specified by class name, wh
```bash
$ classloader --classLoaderClass sun.misc.Launcher$AppClassLoader
file:/private/tmp/arthas-demo.jar
file:/private/tmp/math-game.jar
file:/Users/hengyunabc/.arthas/lib/3.0.5/arthas/arthas-agent.jar
Affect(row-cnt:9) cost in 3 ms.
@ -84,7 +84,7 @@ Affect(row-cnt:9) cost in 3 ms.
```bash
$ classloader -c 3d4eac69 -r META-INF/MANIFEST.MF
jar:file:/System/Library/Java/Extensions/MRJToolkit.jar!/META-INF/MANIFEST.MF
jar:file:/private/tmp/arthas-demo.jar!/META-INF/MANIFEST.MF
jar:file:/private/tmp/math-game.jar!/META-INF/MANIFEST.MF
jar:file:/Users/hengyunabc/.arthas/lib/3.0.5/arthas/arthas-agent.jar!/META-INF/MANIFEST.MF
```
@ -101,7 +101,7 @@ $ classloader -c 1b6d3586 -r java/lang/String.class
$ classloader -c 3d4eac69 --load demo.MathGame
load class success.
class-info demo.MathGame
code-source /private/tmp/arthas-demo.jar
code-source /private/tmp/math-game.jar
name demo.MathGame
isInterface false
isAnnotation false

@ -58,22 +58,22 @@ RUN export JAVA_HOME
## Quick start with Docker
1. Delete the existing `arthas-demo` docker container (not necessary)
1. Delete the existing `math-game` docker container (not necessary)
```sh
$ docker stop arthas-demo || true && docker rm arthas-demo || true
$ docker stop math-game || true && docker rm math-game || true
```
1. Start `arthas-demo`
1. Start `math-game`
```sh
$ docker run --name arthas-demo -it hengyunabc/arthas:latest /bin/sh -c "java -jar /opt/arthas/arthas-demo.jar"
$ docker run --name math-game -it hengyunabc/arthas:latest /bin/sh -c "java -jar /opt/arthas/math-game.jar"
```
1. Start `arthas-boot` for diagnosis
```sh
$ docker exec -it arthas-demo /bin/sh -c "java -jar /opt/arthas/arthas-boot.jar"
$ docker exec -it math-game /bin/sh -c "java -jar /opt/arthas/arthas-boot.jar"
* [1]: 9 jar
[INFO] arthas home: /opt/arthas

@ -18,7 +18,7 @@ com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: ta
1. Check whether the current user and the target java process are consistent. If they are inconsistent, switch to the same user. JVM can only attach java processes under the same user.
2. Try to use `jstack -l $pid`. If the process does not respond, it means that the process may freeze and fail to respond to the JVM attach signal. So Arthas based on the attach mechanism cannot work. Try to use `jmap` heapdump to analyze.
3. Try to attach arthas-demo in [quick-start](quick-start.md).
3. Try to attach math-game in [quick-start](quick-start.md).
4. For more information: [https://github.com/alibaba/arthas/issues/347](https://github.com/alibaba/arthas/issues/347)
@ -57,7 +57,7 @@ You can used all variables in [fundamental fields in expressions](advice-class.m
You can use `-v` to view the condition express result [https://github.com/alibaba/arthas/issues/1348](https://github.com/alibaba/arthas/issues/1348)
example [arthas-demo](quick-start.md)
example [math-game](quick-start.md)
```bash
watch demo.MathGame primeFactors traceE '{params,returnObj,throwExp}' -v -n 5 -x 3 'params.length >0 && returnObj instanceof java.util.List'

@ -93,7 +93,7 @@ ClassLoader:
+-sun.misc.Launcher$ExtClassLoader@7f31245a
Location:
/private/tmp/arthas-demo.jar
/private/tmp/math-game.jar
public static void main(String[] args) throws InterruptedException {
MathGame game = new MathGame();
@ -116,7 +116,7 @@ ClassLoader:
+-sun.misc.Launcher$ExtClassLoader@7f31245a
Location:
/private/tmp/arthas-demo.jar
/private/tmp/math-game.jar
public static void main(String[] args) throws InterruptedException {
MathGame game = new MathGame();

@ -1,16 +1,16 @@
Quick Start
===========
## 1. Start Demo Application
## 1. Start math-game
```bash
curl -O https://arthas.aliyun.com/arthas-demo.jar
java -jar arthas-demo.jar
curl -O https://arthas.aliyun.com/math-game.jar
java -jar math-game.jar
```
`arthas-demo` is a simple program that generates a random number every second, then it finds all prime factors of that number.
`math-game` is a simple program that generates a random number every second, then it finds all prime factors of that number.
The source code of `arthas-demo`: [View](https://github.com/alibaba/arthas/blob/master/demo/src/main/java/demo/MathGame.java)
The source code of `math-game`: [View](https://github.com/alibaba/arthas/blob/master/demo/src/main/java/demo/MathGame.java)
## 2. Start Arthas
@ -32,10 +32,10 @@ Select the target Java process to attach:
```bash
$ $ java -jar arthas-boot.jar
* [1]: 35542
[2]: 71560 arthas-demo.jar
[2]: 71560 math-game.jar
```
The 'Demo' process is the second as shown above, press '2' then 'Enter'. Arthas will attach to the target process, and start to output:
The `math-game` process is the second as shown above, press '2' then 'Enter'. Arthas will attach to the target process, and start to output:
```bash
[INFO] Try to attach process 71560
@ -94,7 +94,7 @@ java.home /Library/Java/JavaVir
e/jre
```
## 4. Get the Main Class of the `arthas-demo` process with the thread command
## 4. Get the Main Class of the `math-game` process with the thread command
`thread 1` will print the stack of the thread with ID 1, which usually the main function thread.
@ -113,7 +113,7 @@ ClassLoader:
+-sun.misc.Launcher$ExtClassLoader@66350f69
Location:
/tmp/arthas-demo.jar
/tmp/math-game.jar
/*
* Decompiled with CFR 0_132.

@ -39,7 +39,7 @@ sc
```bash
$ sc -d demo.MathGame
class-info demo.MathGame
code-source /private/tmp/arthas-demo.jar
code-source /private/tmp/math-game.jar
name demo.MathGame
isInterface false
isAnnotation false
@ -67,7 +67,7 @@ sc
```bash
$ sc -d -f demo.MathGame
class-info demo.MathGame
code-source /private/tmp/arthas-demo.jar
code-source /private/tmp/math-game.jar
name demo.MathGame
isInterface false
isAnnotation false

@ -29,7 +29,7 @@ Pls. refer to [core parameters in expression](advice-class.md) for more details.
#### Start Demo
Start `arthas-demo` in [Quick Start](quick-start.md).
Start `math-game` in [Quick Start](quick-start.md).
#### stack

@ -43,7 +43,7 @@ Many times what we are interested is the exact trace result when the method call
#### Start Demo
Start `arthas-demo` in [Quick Start](quick-start.md).
Start `math-game` in [Quick Start](quick-start.md).
#### Trace method

@ -16,7 +16,7 @@ With the help of `tt` (*TimeTunnel*), you can check the contexts of the methods
#### Start Demo
Start `arthas-demo` in [Quick Start](quick-start.md).
Start `math-game` in [Quick Start](quick-start.md).
#### Record method calls

@ -41,7 +41,7 @@ Advanced:
#### Start Demo
Start `arthas-demo` in [Quick Start](quick-start.md).
Start `math-game` in [Quick Start](quick-start.md).
#### Check the `out parameters` and `return value`

@ -520,15 +520,14 @@ dl.citation > dd:after {
}
dl.field-list {
display: grid;
grid-template-columns: fit-content(30%) auto;
display: flex;
flex-wrap: wrap;
}
dl.field-list > dt {
flex-basis: 20%;
font-weight: bold;
word-break: break-word;
padding-left: 0.5em;
padding-right: 5px;
}
dl.field-list > dt:after {
@ -536,8 +535,8 @@ dl.field-list > dt:after {
}
dl.field-list > dd {
padding-left: 0.5em;
margin-top: 0em;
flex-basis: 70%;
padding-left: 1em;
margin-left: 0em;
margin-bottom: 0em;
}

File diff suppressed because one or more lines are too long

@ -349,13 +349,13 @@
<li><p>Select the process to be attached via the <code class="docutils literal notranslate"><span class="pre">select</span></code> option.</p></li>
</ul>
<p>Normally, <code class="docutils literal notranslate"><span class="pre">as.sh</span></code>/<code class="docutils literal notranslate"><span class="pre">arthas-boot.jar</span></code> needs to a pid, bacause the pid will change.</p>
<p>For example, with <code class="docutils literal notranslate"><span class="pre">arthas-demo.jar</span></code> already started, use the <code class="docutils literal notranslate"><span class="pre">jps</span></code> command to see.</p>
<p>For example, with <code class="docutils literal notranslate"><span class="pre">math-game.jar</span></code> already started, use the <code class="docutils literal notranslate"><span class="pre">jps</span></code> command to see.</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ jps
58883 arthas-demo.jar
58883 math-game.jar
58884 Jps</pre></div>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">select</span></code> option allows you to specify a process name, which is very convenient.</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ ./as.sh --select arthas-demo
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ ./as.sh --select math-game
Arthas script version: 3.3.6
[INFO] JAVA_HOME: /tmp/java/8.0.222-zulu
Arthas home: /Users/admin/.arthas/lib/3.3.6/arthas

@ -209,7 +209,7 @@
<h1>Start as a Java Agent<a class="headerlink" href="#start-as-a-java-agent" title="Permalink to this headline"></a></h1>
<p>Usually Arthas dynamic attach the applications on the fly, but from version <code class="docutils literal notranslate"><span class="pre">3.2.0</span></code> onwards, Arthas supports starting directly as a java agent.</p>
<p>For example, download the full arthas zip package, decompress it and start it by specifying <code class="docutils literal notranslate"><span class="pre">arthas-agent.jar</span></code> with the parameter <code class="docutils literal notranslate"><span class="pre">-javaagent</span></code>.</p>
<div class="highlight-default notranslate"><pre class="literal-block">java -javaagent:/tmp/test/arthas-agent.jar -jar arthas-demo.jar</pre>
<div class="highlight-default notranslate"><pre class="literal-block">java -javaagent:/tmp/test/arthas-agent.jar -jar math-game.jar</pre>
</div>
<p>The default configuration is in the <code class="docutils literal notranslate"><span class="pre">arthas.properties</span></code> file in the decompression directory. Reference: <a class="reference internal" href="arthas-properties.html"><span class="doc">Arthas Properties</span></a></p>
<p>Reference: https://docs.oracle.com/javase/8/docs/api/java/lang/instrument/package-summary.html</p>

@ -317,7 +317,7 @@ Affect(row-cnt:4) cost in 3 ms.</pre></div>
<div class="section" id="show-the-urls-of-the-urlclassloader">
<h3>Show the URLs of the URLClassLoader<a class="headerlink" href="#show-the-urls-of-the-urlclassloader" title="Permalink to this headline"></a></h3>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ classloader -c 3d4eac69
file:/private/tmp/arthas-demo.jar
file:/private/tmp/math-game.jar
file:/Users/hengyunabc/.arthas/lib/3.0.5/arthas/arthas-agent.jar
Affect(row-cnt:9) cost in 3 ms.</pre></div>
@ -325,7 +325,7 @@ Affect(row-cnt:9) cost in 3 ms.</pre></div>
<p>Note that the hashcode changes, you need to check the current ClassLoader information first, and extract the hashcode corresponding to the ClassLoader.</p>
<p>For ClassLoader with only unique instance, it can be specified by class name, which is more convenient to use:</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ classloader --classLoaderClass sun.misc.Launcher$AppClassLoader
file:/private/tmp/arthas-demo.jar
file:/private/tmp/math-game.jar
file:/Users/hengyunabc/.arthas/lib/3.0.5/arthas/arthas-agent.jar
Affect(row-cnt:9) cost in 3 ms.</pre></div>
@ -335,7 +335,7 @@ Affect(row-cnt:9) cost in 3 ms.</pre></div>
<h3>Use the classloader to load resource<a class="headerlink" href="#use-the-classloader-to-load-resource" title="Permalink to this headline"></a></h3>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ classloader -c 3d4eac69 -r META-INF/MANIFEST.MF
jar:file:/System/Library/Java/Extensions/MRJToolkit.jar!/META-INF/MANIFEST.MF
jar:file:/private/tmp/arthas-demo.jar!/META-INF/MANIFEST.MF
jar:file:/private/tmp/math-game.jar!/META-INF/MANIFEST.MF
jar:file:/Users/hengyunabc/.arthas/lib/3.0.5/arthas/arthas-agent.jar!/META-INF/MANIFEST.MF</pre></div>
</div>
<p>Use the classloader to load <code class="docutils literal notranslate"><span class="pre">.class</span></code> resource</p>
@ -348,7 +348,7 @@ Affect(row-cnt:9) cost in 3 ms.</pre></div>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ classloader -c 3d4eac69 --load demo.MathGame
load class success.
class-info demo.MathGame
code-source /private/tmp/arthas-demo.jar
code-source /private/tmp/math-game.jar
name demo.MathGame
isInterface false
isAnnotation false

@ -330,7 +330,7 @@ Because the JIT compilation data related to this class is cleared when the JVM h
</div>
<div class="section" id="screenshot">
<h2>Screenshot<a class="headerlink" href="#screenshot" title="Permalink to this headline"></a></h2>
<p><img alt="_images/dashboard.png" src="_images/dashboard.png" /></p>
<p><img alt="dashboard" src="_images/dashboard.png" /></p>
</div>
</div>

@ -243,16 +243,16 @@ RUN export JAVA_HOME</pre></div>
<div class="section" id="quick-start-with-docker">
<h2>Quick start with Docker<a class="headerlink" href="#quick-start-with-docker" title="Permalink to this headline"></a></h2>
<ol>
<li><p>Delete the existing <code class="docutils literal notranslate"><span class="pre">arthas-demo</span></code> docker container (not necessary)</p>
<div class="highlight-sh notranslate"><div class="highlight hljs"><pre class="sh">$ docker stop arthas-demo || true &amp;&amp; docker rm arthas-demo || true</pre></div>
<li><p>Delete the existing <code class="docutils literal notranslate"><span class="pre">math-game</span></code> docker container (not necessary)</p>
<div class="highlight-sh notranslate"><div class="highlight hljs"><pre class="sh">$ docker stop math-game || true &amp;&amp; docker rm math-game || true</pre></div>
</div>
</li>
<li><p>Start <code class="docutils literal notranslate"><span class="pre">arthas-demo</span></code></p>
<div class="highlight-sh notranslate"><div class="highlight hljs"><pre class="sh">$ docker run --name arthas-demo -it hengyunabc/arthas:latest /bin/sh -c &quot;java -jar /opt/arthas/arthas-demo.jar&quot;</pre></div>
<li><p>Start <code class="docutils literal notranslate"><span class="pre">math-game</span></code></p>
<div class="highlight-sh notranslate"><div class="highlight hljs"><pre class="sh">$ docker run --name math-game -it hengyunabc/arthas:latest /bin/sh -c &quot;java -jar /opt/arthas/math-game.jar&quot;</pre></div>
</div>
</li>
<li><p>Start <code class="docutils literal notranslate"><span class="pre">arthas-boot</span></code> for diagnosis</p>
<div class="highlight-sh notranslate"><div class="highlight hljs"><pre class="sh">$ docker exec -it arthas-demo /bin/sh -c &quot;java -jar /opt/arthas/arthas-boot.jar&quot;
<div class="highlight-sh notranslate"><div class="highlight hljs"><pre class="sh">$ docker exec -it math-game /bin/sh -c &quot;java -jar /opt/arthas/arthas-boot.jar&quot;
* [1]: 9 jar
[INFO] arthas home: /opt/arthas

@ -199,7 +199,7 @@
<h2>Download full package<a class="headerlink" href="#download-full-package" title="Permalink to this headline"></a></h2>
<div class="section" id="download-from-maven-central">
<h3>Download from maven central<a class="headerlink" href="#download-from-maven-central" title="Permalink to this headline"></a></h3>
<p>Latest Version, Click To Download: <a class="reference external" href="https://arthas.aliyun.com/download/latest_version"><img alt="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
<p>Latest Version, Click To Download: <a class="reference external" href="https://arthas.aliyun.com/download/latest_version"><img alt="Arthas" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
</div>
<div class="section" id="download-from-github-releases">
<h3>Download from Github Releases<a class="headerlink" href="#download-from-github-releases" title="Permalink to this headline"></a></h3>
@ -226,7 +226,7 @@
</div>
<div class="section" id="download-offline-help-documentation">
<h2>Download Offline Help Documentation<a class="headerlink" href="#download-offline-help-documentation" title="Permalink to this headline"></a></h2>
<p>Latest Version Documentation, Click To Download:<a class="reference external" href="https://arthas.aliyun.com/download/doc/latest_version"><img alt="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
<p>Latest Version Documentation, Click To Download:<a class="reference external" href="https://arthas.aliyun.com/download/doc/latest_version"><img alt="Arthas" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
</div>
</div>

@ -216,7 +216,7 @@
<ol class="simple">
<li><p>Check whether the current user and the target java process are consistent. If they are inconsistent, switch to the same user. JVM can only attach java processes under the same user.</p></li>
<li><p>Try to use <code class="docutils literal notranslate"><span class="pre">jstack</span> <span class="pre">-l</span> <span class="pre">$pid</span></code>. If the process does not respond, it means that the process may freeze and fail to respond to the JVM attach signal. So Arthas based on the attach mechanism cannot work. Try to use <code class="docutils literal notranslate"><span class="pre">jmap</span></code> heapdump to analyze.</p></li>
<li><p>Try to attach arthas-demo in <a class="reference internal" href="quick-start.html"><span class="doc">quick-start</span></a>.</p></li>
<li><p>Try to attach math-game in <a class="reference internal" href="quick-start.html"><span class="doc">quick-start</span></a>.</p></li>
<li><p>For more information: <a class="reference external" href="https://github.com/alibaba/arthas/issues/347">https://github.com/alibaba/arthas/issues/347</a></p></li>
</ol>
</div>
@ -245,7 +245,7 @@
<h2>How to filter method with the same name?<a class="headerlink" href="#how-to-filter-method-with-the-same-name" title="Permalink to this headline"></a></h2>
<p>You can used all variables in <a class="reference internal" href="advice-class.html"><span class="doc">fundamental fields in expressions</span></a> for the condition express to filter method with the same name, you can use the number of parameters <code class="docutils literal notranslate"><span class="pre">params.length</span> <span class="pre">==1</span></code>,parameter type <code class="docutils literal notranslate"><span class="pre">params[0]</span> <span class="pre">instanceof</span> <span class="pre">java.lang.Integer</span></code>,return value type <code class="docutils literal notranslate"><span class="pre">returnObj</span> <span class="pre">instanceof</span> <span class="pre">java.util.List</span></code> and so on in one or more combinations as condition express.</p>
<p>You can use <code class="docutils literal notranslate"><span class="pre">-v</span></code> to view the condition express result <a class="reference external" href="https://github.com/alibaba/arthas/issues/1348">https://github.com/alibaba/arthas/issues/1348</a></p>
<p>example <a class="reference internal" href="quick-start.html"><span class="doc">arthas-demo</span></a></p>
<p>example <a class="reference internal" href="quick-start.html"><span class="doc">math-game</span></a></p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">watch demo.MathGame primeFactors traceE &#x27;{params,returnObj,throwExp}&#x27; -v -n 5 -x 3 &#x27;params.length &gt;0 &amp;&amp; returnObj instanceof java.util.List&#x27;</pre></div>
</div>
</div>

@ -666,7 +666,7 @@ corresponds to the expression in the corresponding order.</p>
</div>
<div class="section" id="web-ui">
<h2>Web UI<a class="headerlink" href="#web-ui" title="Permalink to this headline"></a></h2>
<p><img alt="_images/arthas-web-ui.png" src="_images/arthas-web-ui.png" /></p>
<p><img alt="arthas web ui" src="_images/arthas-web-ui.png" /></p>
<p>A Web UI based on Http API, visit url :
<a class="reference external" href="http://127.0.0.1:8563/ui">http://127.0.0.1:8563/ui</a> .</p>
<p>Completed functions:</p>

@ -225,7 +225,7 @@ java -jar arthas-boot.jar</pre></div>
</div>
<div class="section" id="full-installation">
<h2>Full installation<a class="headerlink" href="#full-installation" title="Permalink to this headline"></a></h2>
<p>Latest Version, Click To Download: <a class="reference external" href="https://arthas.aliyun.com/download/latest_version"><img alt="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
<p>Latest Version, Click To Download: <a class="reference external" href="https://arthas.aliyun.com/download/latest_version"><img alt="Arthas" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
<p>Download and unzip, find <code class="docutils literal notranslate"><span class="pre">arthas-boot.jar</span></code> in the directory. Start with <code class="docutils literal notranslate"><span class="pre">java</span></code> command:</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">java -jar arthas-boot.jar</pre></div>
</div>
@ -260,7 +260,7 @@ you can get them from the github releases page https://github.com/alibaba/arthas
</div>
<div class="section" id="offline-help-documentation">
<h2>Offline Help Documentation<a class="headerlink" href="#offline-help-documentation" title="Permalink to this headline"></a></h2>
<p>Latest Version Documentation, Click To Download:<a class="reference external" href="https://arthas.aliyun.com/download/doc/latest_version"><img alt="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
<p>Latest Version Documentation, Click To Download:<a class="reference external" href="https://arthas.aliyun.com/download/doc/latest_version"><img alt="Arthas" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
</div>
<div class="section" id="uninstall">
<h2>Uninstall<a class="headerlink" href="#uninstall" title="Permalink to this headline"></a></h2>

@ -341,7 +341,7 @@ ClassLoader:
+-sun.misc.Launcher$ExtClassLoader@7f31245a
Location:
/private/tmp/arthas-demo.jar
/private/tmp/math-game.jar
public static void main(String[] args) throws InterruptedException {
MathGame game = new MathGame();
@ -364,7 +364,7 @@ ClassLoader:
+-sun.misc.Launcher$ExtClassLoader@7f31245a
Location:
/private/tmp/arthas-demo.jar
/private/tmp/math-game.jar
public static void main(String[] args) throws InterruptedException {
MathGame game = new MathGame();

@ -187,7 +187,7 @@
<h2>Manually Install Arthas<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h2>
<ol>
<li><p>Download the latest version</p>
<p><strong>Latest version, Click To Download</strong>: <a class="reference external" href="https://arthas.aliyun.com/download/latest_version"><img alt="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
<p><strong>Latest version, Click To Download</strong>: <a class="reference external" href="https://arthas.aliyun.com/download/latest_version"><img alt="Arthas" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
</li>
<li><p>Unzip zip file</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">unzip arthas-packaging-bin.zip</pre></div>
@ -220,7 +220,7 @@ cd arthas
</div>
<div class="section" id="windows">
<h3>Windows<a class="headerlink" href="#windows" title="Permalink to this headline"></a></h3>
<p>Latest Version, Click To Download: <a class="reference external" href="https://arthas.aliyun.com/download/latest_version"><img alt="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
<p>Latest Version, Click To Download: <a class="reference external" href="https://arthas.aliyun.com/download/latest_version"><img alt="Arthas" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
<p>Download and unzip, then find <code class="docutils literal notranslate"><span class="pre">as.bat</span></code> from bin directory. For now this script will only take one argument <code class="docutils literal notranslate"><span class="pre">pid</span></code>, which means you can only diagnose the local Java process. (Welcome any bat script expert to make it better :heart:)</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">as.bat &lt;pid&gt;</pre></div>
</div>

@ -103,13 +103,13 @@
<li class="toctree-l1"><a class="reference internal" href="install-detail.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="download.html">Download</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Quick start</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#start-demo-application">1. Start Demo Application</a></li>
<li class="toctree-l2"><a class="reference internal" href="#start-math-game">1. Start math-game</a></li>
<li class="toctree-l2"><a class="reference internal" href="#start-arthas">2. Start Arthas</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#linux-unix-mac">Linux/Unix/Mac</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#check-the-dashboard">3. Check the Dashboard</a></li>
<li class="toctree-l2"><a class="reference internal" href="#get-the-main-class-of-the-arthas-demo-process-with-the-thread-command">4. Get the Main Class of the <code class="docutils literal notranslate"><span class="pre">arthas-demo</span></code> process with the thread command</a></li>
<li class="toctree-l2"><a class="reference internal" href="#get-the-main-class-of-the-math-game-process-with-the-thread-command">4. Get the Main Class of the <code class="docutils literal notranslate"><span class="pre">math-game</span></code> process with the thread command</a></li>
<li class="toctree-l2"><a class="reference internal" href="#decompile-main-class-with-jad-command">5. Decompile Main Class with jad command</a></li>
<li class="toctree-l2"><a class="reference internal" href="#watch">6. watch</a></li>
<li class="toctree-l2"><a class="reference internal" href="#exit-arthas">7. Exit Arthas</a></li>
@ -197,13 +197,13 @@
<div class="section" id="quick-start">
<h1>Quick Start<a class="headerlink" href="#quick-start" title="Permalink to this headline"></a></h1>
<div class="section" id="start-demo-application">
<h2>1. Start Demo Application<a class="headerlink" href="#start-demo-application" title="Permalink to this headline"></a></h2>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">curl -O https://arthas.aliyun.com/arthas-demo.jar
java -jar arthas-demo.jar</pre></div>
<div class="section" id="start-math-game">
<h2>1. Start math-game<a class="headerlink" href="#start-math-game" title="Permalink to this headline"></a></h2>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">curl -O https://arthas.aliyun.com/math-game.jar
java -jar math-game.jar</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">arthas-demo</span></code> is a simple program that generates a random number every second, then it finds all prime factors of that number.</p>
<p>The source code of <code class="docutils literal notranslate"><span class="pre">arthas-demo</span></code>: <a class="reference external" href="https://github.com/alibaba/arthas/blob/master/demo/src/main/java/demo/MathGame.java">View</a></p>
<p><code class="docutils literal notranslate"><span class="pre">math-game</span></code> is a simple program that generates a random number every second, then it finds all prime factors of that number.</p>
<p>The source code of <code class="docutils literal notranslate"><span class="pre">math-game</span></code>: <a class="reference external" href="https://github.com/alibaba/arthas/blob/master/demo/src/main/java/demo/MathGame.java">View</a></p>
</div>
<div class="section" id="start-arthas">
<h2>2. Start Arthas<a class="headerlink" href="#start-arthas" title="Permalink to this headline"></a></h2>
@ -221,9 +221,9 @@ java -jar arthas-boot.jar</pre></div>
<p>Select the target Java process to attach:</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ $ java -jar arthas-boot.jar
* [1]: 35542
[2]: 71560 arthas-demo.jar</pre></div>
[2]: 71560 math-game.jar</pre></div>
</div>
<p>The Demo process is the second as shown above, press 2 then Enter. Arthas will attach to the target process, and start to output:</p>
<p>The <code class="docutils literal notranslate"><span class="pre">math-game</span></code> process is the second as shown above, press 2 then Enter. Arthas will attach to the target process, and start to output:</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">[INFO] Try to attach process 71560
[INFO] Attach process 71560 success.
[INFO] arthas-client connect 127.0.0.1 3658
@ -278,8 +278,8 @@ java.home /Library/Java/JavaVir
e/jre</pre></div>
</div>
</div>
<div class="section" id="get-the-main-class-of-the-arthas-demo-process-with-the-thread-command">
<h2>4. Get the Main Class of the <code class="docutils literal notranslate"><span class="pre">arthas-demo</span></code> process with the thread command<a class="headerlink" href="#get-the-main-class-of-the-arthas-demo-process-with-the-thread-command" title="Permalink to this headline"></a></h2>
<div class="section" id="get-the-main-class-of-the-math-game-process-with-the-thread-command">
<h2>4. Get the Main Class of the <code class="docutils literal notranslate"><span class="pre">math-game</span></code> process with the thread command<a class="headerlink" href="#get-the-main-class-of-the-math-game-process-with-the-thread-command" title="Permalink to this headline"></a></h2>
<p><code class="docutils literal notranslate"><span class="pre">thread</span> <span class="pre">1</span></code> will print the stack of the thread with ID 1, which usually the main function thread.</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ thread 1 | grep &#x27;main(&#x27;
at demo.MathGame.main(MathGame.java:17)</pre></div>
@ -294,7 +294,7 @@ ClassLoader:
+-sun.misc.Launcher$ExtClassLoader@66350f69
Location:
/tmp/arthas-demo.jar
/tmp/math-game.jar
/*
* Decompiled with CFR 0_132.

@ -297,7 +297,7 @@ Affect(row-cnt:1) cost in 55 ms.</pre></div>
<li><p>View class details</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ sc -d demo.MathGame
class-info demo.MathGame
code-source /private/tmp/arthas-demo.jar
code-source /private/tmp/math-game.jar
name demo.MathGame
isInterface false
isAnnotation false
@ -323,7 +323,7 @@ Affect(row-cnt:1) cost in 875 ms.</pre></div>
<li><p>View class fields</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ sc -d -f demo.MathGame
class-info demo.MathGame
code-source /private/tmp/arthas-demo.jar
code-source /private/tmp/math-game.jar
name demo.MathGame
isInterface false
isAnnotation false

File diff suppressed because one or more lines are too long

@ -282,7 +282,7 @@
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h2>
<div class="section" id="start-demo">
<h3>Start Demo<a class="headerlink" href="#start-demo" title="Permalink to this headline"></a></h3>
<p>Start <code class="docutils literal notranslate"><span class="pre">arthas-demo</span></code> in <a class="reference internal" href="quick-start.html"><span class="doc">Quick Start</span></a>.</p>
<p>Start <code class="docutils literal notranslate"><span class="pre">math-game</span></code> in <a class="reference internal" href="quick-start.html"><span class="doc">Quick Start</span></a>.</p>
</div>
<div class="section" id="id1">
<h3>stack<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h3>

@ -304,7 +304,7 @@
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h2>
<div class="section" id="start-demo">
<h3>Start Demo<a class="headerlink" href="#start-demo" title="Permalink to this headline"></a></h3>
<p>Start <code class="docutils literal notranslate"><span class="pre">arthas-demo</span></code> in <a class="reference internal" href="quick-start.html"><span class="doc">Quick Start</span></a>.</p>
<p>Start <code class="docutils literal notranslate"><span class="pre">math-game</span></code> in <a class="reference internal" href="quick-start.html"><span class="doc">Quick Start</span></a>.</p>
</div>
<div class="section" id="trace-method">
<h3>Trace method<a class="headerlink" href="#trace-method" title="Permalink to this headline"></a></h3>

@ -245,7 +245,7 @@
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h2>
<div class="section" id="start-demo">
<h3>Start Demo<a class="headerlink" href="#start-demo" title="Permalink to this headline"></a></h3>
<p>Start <code class="docutils literal notranslate"><span class="pre">arthas-demo</span></code> in <a class="reference internal" href="quick-start.html"><span class="doc">Quick Start</span></a>.</p>
<p>Start <code class="docutils literal notranslate"><span class="pre">math-game</span></code> in <a class="reference internal" href="quick-start.html"><span class="doc">Quick Start</span></a>.</p>
</div>
<div class="section" id="record-method-calls">
<h3>Record method calls<a class="headerlink" href="#record-method-calls" title="Permalink to this headline"></a></h3>

@ -324,7 +324,7 @@
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h2>
<div class="section" id="start-demo">
<h3>Start Demo<a class="headerlink" href="#start-demo" title="Permalink to this headline"></a></h3>
<p>Start <code class="docutils literal notranslate"><span class="pre">arthas-demo</span></code> in <a class="reference internal" href="quick-start.html"><span class="doc">Quick Start</span></a>.</p>
<p>Start <code class="docutils literal notranslate"><span class="pre">math-game</span></code> in <a class="reference internal" href="quick-start.html"><span class="doc">Quick Start</span></a>.</p>
</div>
<div class="section" id="check-the-out-parameters-and-return-value">
<h3>Check the <code class="docutils literal notranslate"><span class="pre">out</span> <span class="pre">parameters</span></code> and <code class="docutils literal notranslate"><span class="pre">return</span> <span class="pre">value</span></code><a class="headerlink" href="#check-the-out-parameters-and-return-value" title="Permalink to this headline"></a></h3>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>
@ -221,7 +220,7 @@
<ol class="simple">
<li><p>检查当前用户和目标java进程是否一致。如果不一致则切换到同一用户。JVM只能attach同样用户下的java 进程。</p></li>
<li><p>尝试使用 <code class="docutils literal notranslate"><span class="pre">jstack</span> <span class="pre">-l</span> <span class="pre">$pid</span></code>如果进程没有反应则说明进程可能假死无法响应JVM attach信号。所以同样基于attach机制的Arthas无法工作。尝试使用<code class="docutils literal notranslate"><span class="pre">jmap</span></code> heapdump后分析。</p></li>
<li><p>尝试<a class="reference internal" href="quick-start.html"><span class="doc">quick-start</span></a>里的方式attach arthas-demo</p></li>
<li><p>尝试<a class="reference internal" href="quick-start.html"><span class="doc">quick-start</span></a>里的方式attach math-game</p></li>
<li><p>更多情况参考: <a class="reference external" href="https://github.com/alibaba/arthas/issues/347">https://github.com/alibaba/arthas/issues/347</a></p></li>
</ol>
</div>
@ -250,7 +249,7 @@
<h2>方法同名过滤<a class="headerlink" href="#id3" title="永久链接至标题"></a></h2>
<p>同名方法过滤可以通过匹配表达式,可以使用<a class="reference internal" href="advice-class.html"><span class="doc">表达式核心变量</span></a>中所有变量作为已知条件,可以通过判断参数个数<code class="docutils literal notranslate"><span class="pre">params.length</span> <span class="pre">==1</span></code>, 参数类型<code class="docutils literal notranslate"><span class="pre">params[0]</span> <span class="pre">instanceof</span> <span class="pre">java.lang.Integer</span></code>、返回值类型 <code class="docutils literal notranslate"><span class="pre">returnObj</span> <span class="pre">instanceof</span> <span class="pre">java.util.List</span></code> 等等一种或者多种组合进行过滤。</p>
<p>可以使用 <code class="docutils literal notranslate"><span class="pre">-v</span></code> 查看观察匹配表达式的执行结果 <a class="reference external" href="https://github.com/alibaba/arthas/issues/1348">https://github.com/alibaba/arthas/issues/1348</a></p>
<p>例子<a class="reference internal" href="quick-start.html"><span class="doc">arthas-demo</span></a></p>
<p>例子<a class="reference internal" href="quick-start.html"><span class="doc">math-game</span></a></p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">watch demo.MathGame primeFactors traceE &#x27;{params,returnObj,throwExp}&#x27; -v -n 5 -x 3 &#x27;params.length &gt;0 &amp;&amp; returnObj instanceof java.util.List&#x27;</pre></div>
</div>
</div>

@ -99,7 +99,6 @@
<ul>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

@ -98,7 +98,6 @@
<ul>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>

@ -100,7 +100,6 @@
<ul class="current">
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/">首页</a></li>
<li class="toctree-l1"><a class="reference external" href="https://mp.weixin.qq.com/s/jfjvBmrKmHDdKn-Iez-c4Q">2022实习生招聘</a></li>
<li class="toctree-l1"><a class="reference external" href="https://developer.aliyun.com/article/751641">技术分享征文</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/en/">English Docs</a></li>
<li class="toctree-l1"><a class="reference external" href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn">在线教程(katacoda)</a></li>
@ -618,7 +617,7 @@ API可以提供结构化的数据支持更复杂的交互功能比如特
</div>
<div class="section" id="web-ui">
<h2>Web UI<a class="headerlink" href="#web-ui" title="永久链接至标题"></a></h2>
<p><img alt="_images/arthas-web-ui.png" src="_images/arthas-web-ui.png" /></p>
<p><img alt="arthas web ui" src="_images/arthas-web-ui.png" /></p>
<p>一个基于Http API接口实现的Web UI访问地址为 <a class="reference external" href="http://127.0.0.1:8563/ui">http://127.0.0.1:8563/ui</a></p>
<p>已实现功能:</p>
<ul class="simple">

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save