site/docs/en/doc/faq.md
::: tip For questions that are not in this list, please search in issues. https://github.com/alibaba/arthas/issues :::
Log file path: ~/logs/arthas/arthas.log
~/logs/arthas/arthas.logas.sh/arthas-boot.jar, whether a specific port is specifiednetstat to check the process of LISTEN 3658 port, confirm it is a java process, and it is the process you want to diagnoseLISTEN 3658 port is not a java process, then the 3658 port is already occupied. You need to specify other ports in the startup parameters of as.sh/arthas-boot.jar.telnet 127.0.0.1 3658Essentially, arthas will start a tcp server within the application java process, and then use telnet to connect to it.
If there is Arthas server already bind. in the Arthas log
Arthas server has been started before, check the file descriptors opened by the target process. If it is a linux environment, you can go to /proc/$pid/fd, use ls -alh | grep arthas to check whether the process has loaded the arthas related jar package.arthas, or the application has been restarted.https://github.com/alibaba/arthas/issues/44
com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
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.By default, classes beginning with java. or the classes loaded by the Bootstrap ClassLoader are filtered out, but they can be turned on:
options unsafe true
See more at options
::: tip To support the jars appended by java.lang.instrument.Instrumentation#appendToBootstrapClassLoaderSearch need to enable unsafe. :::
json formatoptions json-format true
See more at options
No.
vmtool command.tt command, or fetch it from a static method.You can used all variables in fundamental fields in expressions for the condition express to filter method with the same name, you can use the number of parameters params.length ==1,parameter type params[0] instanceof java.lang.Integer,return value type returnObj instanceof java.util.List and so on in one or more combinations as condition express.
You can use -v to view the condition express result https://github.com/alibaba/arthas/issues/1348
example math-game
watch demo.MathGame primeFactors '{params,returnObj,throwExp}' 'params.length >0 && returnObj instanceof java.util.List' -v
watch demo.MathGame <init> '{params,returnObj,throwExp}' -v
In the JVM specification the name of inner classes is OuterClass$InnerClass.
watch OuterClass$InnerClass
For classes generated by lambda, will be skipped because the JVM itself does not allow enhancements to classes generated by lambda.
Convert Unicode characters to \u representation:
ognl '@[email protected]("Hello \u4e2d\u6587")'
When error log appear java.lang.ClassFormatError: null, it is usually modified by other bytecode tools that are not compatible with arthas modified bytecode.
For example: use skywalking V8.1.0 below cannot trace, watch classes enhanced by skywalking agent, V8.1.0 or above is compatible, refer to skywalking configuration for more details. skywalking compatible with other javaagent bytecode processing.
Reference: https://github.com/alibaba/arthas/issues/2165
Yes. Just download the full size package and unzip it, refer to: Download.
as.sh/arthas-boot.jar, you can specify it with the --use-version parameter.Reference: https://github.com/alibaba/arthas/issues/362#issuecomment-448185416
For example, the started version of as.sh/arthas-boot.jar is 3.5., but after connecting, the printed arthas version is 3.4..
It may be that the target process has been diagnosed with the old version of arthas before. You can execute stop to stop the old version of arthas, and then reuse the new version to attach.
Reference: