FAQ¶
不在本列表里的问题,请到issue里搜索。 https://github.com/alibaba/arthas/issues
日志文件在哪里?¶
日志文件路径: ~/logs/arthas/arthas.log
Arthas attach之后对原进程性能有多大的影响¶
target process not responding or HotSpot VM not loaded¶
com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
检查当前用户和目标java进程是否一致。如果不一致,则切换到同一用户。JVM只能attach同样用户下的java 进程。
尝试使用
jstack -l $pid,如果进程没有反应,则说明进程可能假死,无法响应JVM attach信号。所以同样基于attach机制的Arthas无法工作。尝试使用jmapheapdump后分析。尝试按quick-start里的方式attach math-game。
Arthas能否跟踪 native 函数¶
不能。
方法同名过滤¶
同名方法过滤可以通过匹配表达式,可以使用表达式核心变量中所有变量作为已知条件,可以通过判断参数个数params.length ==1, 参数类型params[0] instanceof java.lang.Integer、返回值类型 returnObj instanceof java.util.List 等等一种或者多种组合进行过滤。
可以使用 -v 查看观察匹配表达式的执行结果 https://github.com/alibaba/arthas/issues/1348
watch demo.MathGame primeFactors '{params,returnObj,throwExp}' 'params.length >0 && returnObj instanceof java.util.List' -v怎么watch、trace 构造函数 ?¶
watch demo.MathGame <init> '{params,returnObj,throwExp}' -vjava.lang.ClassFormatError: null、skywalking arthas 兼容使用¶
当出现这个错误日志java.lang.ClassFormatError: null,通常情况下都是被其他字节码工具修改过与arthas修改字节码不兼容。
比如: 使用 skywalking V8.1.0 以下版本 无法trace、watch 被skywalking agent 增强过的类, V8.1.0 以上版本可以兼容使用,更多参考skywalking配置 skywalking compatible with other javaagent bytecode processing。
Attach docker/k8s 里的 pid 为 1 的进程失败¶
参考: https://github.com/alibaba/arthas/issues/362#issuecomment-448185416
为什么下载了新版本的Arthas,连接的却是旧版本?¶
比如启动的 as.sh/arthas-boot.jar 版本是3.5.* 的,但是连接上之后,打印的arthas版本是 3.4.* 的。
可能是之前使用旧版本的arthas诊断过目标进程。可以先执行stop停止掉旧版本的arthas,再重新使用新版本attach。