使用arthas 查看jvm信息的时候报错
Error during processing the command: java.lang.NullPointerException, message:null, please check $HOME/logs/arthas/arthas.log for more details.
看了下日志:
2021-04-17 22:28:04 [arthas-NettyHttpTelnetBootstrap-3-2] INFO c.t.a.core.shell.term.impl.Helper -Loaded arthas keymap file from com/taobao/arthas/core/shell/term/readline/inputrc
2021-04-17 22:28:09 [arthas-command-execute] ERROR c.t.a.c.s.system.impl.ProcessImpl -Error during processing the command:
java.lang.NullPointerException: null
at com.taobao.arthas.core.command.monitor200.JvmCommand.addCompilation(JvmCommand.java:119)
at com.taobao.arthas.core.command.monitor200.JvmCommand.process(JvmCommand.java:48)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.process(AnnotatedCommandImpl.java:82)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.access$100(AnnotatedCommandImpl.java:18)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:111)
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:108)
at com.taobao.arthas.core.shell.system.impl.ProcessImpl$CommandProcessTask.run(ProcessImpl.java:385)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
网上搜不到相关文章,看了一下源码
在 VMManagementImpl 类 跟踪到如下代码:
public String getCompilerName() {
String var1 = (String)AccessController.doPrivileged(new PrivilegedAction<String>() {
public String run() {
return System.getProperty("sun.management.compiler");
}
});
return var1;
}
猜测arthas没有读到compiler info
手动获取到java 的compile info 并在arthas设置属性,问题解决:
[arthas@2650]$ sysprop sun.management.compiler
There is no property with the key sun.management.compiler
[arthas@2650]$ sysprop sun.management.compiler HotSpot\ 64-Bit\ Tiered\ Compilers