You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arthas/site/docs/doc/agent.md

14 lines
593 B
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 以 Java Agent 的方式启动
通常 Arthas 是以动态 attach 的方式来诊断应用,但从`3.2.0`版本起Arthas 支持直接以 java agent 的方式启动。
比如下载全量的 arthas zip 包,解压之后以 `-javaagent` 的参数指定`arthas-agent.jar`来启动:
```
java -javaagent:/tmp/test/arthas-agent.jar -jar math-game.jar
```
默认的配置项在解压目录里的`arthas.properties`文件里。参考:[Arthas Properties](arthas-properties.md)
Java Agent 机制参考: https://docs.oracle.com/javase/8/docs/api/java/lang/instrument/package-summary.html