[alibaba/arthas]在openj9场景下使用arthas有问题

2024-07-17 602 views
1
环境信息
  • arthas-boot.jar 或者 as.sh 的版本: 3.6.3
  • Arthas 版本: 3.6.3
  • 操作系统版本: macos m1
  • 目标进程的JVM版本: xxx
  • 执行arthas-boot的版本: xxx
重现问题的步骤

使用openj9并启用-Xgcpolicy:balanced的gc策略,在arthas attach之后执行dashboard报错

[arthas@73192]$ dashboard
process dashboard failed: init argument cannot be less than -1
期望的结果

能够正常使用dashboard

实际运行的结果

实际运行结果,最好有详细的日志,异常栈。尽量贴文本。 查阅日志报错如下:

2023-02-24 17:22:58 [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
2023-02-24 17:23:02 [Timer-for-arthas-dashboard-4d8b08d3-930a-4d47-b08c-eeaff45f526b] ERROR c.t.a.c.c.m.DashboardCommand -process dashboard failed: init argument cannot be less than -1
java.lang.IllegalArgumentException: init argument cannot be less than -1
        at java.lang.management.MemoryUsage.<init>(MemoryUsage.java:94)
        at com.ibm.java.lang.management.internal.MemoryPoolMXBeanImpl.getUsageImpl(Native Method)
        at com.ibm.java.lang.management.internal.MemoryPoolMXBeanImpl.getUsage(MemoryPoolMXBeanImpl.java:235)
        at com.taobao.arthas.core.command.monitor200.MemoryCommand.getUsage(MemoryCommand.java:82)
        at com.taobao.arthas.core.command.monitor200.MemoryCommand.memoryInfo(MemoryCommand.java:52)
        at com.taobao.arthas.core.command.monitor200.DashboardCommand$DashboardTimerTask.run(DashboardCommand.java:245)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)
2023-02-24 17:23:14 [Timer-for-arthas-dashboard-4d8b08d3-930a-4d47-b08c-eeaff45f526b] ERROR c.t.a.c.c.m.DashboardCommand -process dashboard failed: init argument cannot be less than -1
java.lang.IllegalArgumentException: init argument cannot be less than -1
        at java.lang.management.MemoryUsage.<init>(MemoryUsage.java:94)
        at com.ibm.java.lang.management.internal.MemoryPoolMXBeanImpl.getUsageImpl(Native Method)
        at com.ibm.java.lang.management.internal.MemoryPoolMXBeanImpl.getUsage(MemoryPoolMXBeanImpl.java:235)
        at com.taobao.arthas.core.command.monitor200.MemoryCommand.getUsage(MemoryCommand.java:82)
        at com.taobao.arthas.core.command.monitor200.MemoryCommand.memoryInfo(MemoryCommand.java:52)
        at com.taobao.arthas.core.command.monitor200.DashboardCommand$DashboardTimerTask.run(DashboardCommand.java:245)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)
2023-02-24 17:23:18 [Timer-for-arthas-dashboard-4d8b08d3-930a-4d47-b08c-eeaff45f526b] ERROR c.t.a.c.c.m.DashboardCommand -process dashboard failed: init argument cannot be less than -1
java.lang.IllegalArgumentException: init argument cannot be less than -1
        at java.lang.management.MemoryUsage.<init>(MemoryUsage.java:94)
        at com.ibm.java.lang.management.internal.MemoryPoolMXBeanImpl.getUsageImpl(Native Method)
        at com.ibm.java.lang.management.internal.MemoryPoolMXBeanImpl.getUsage(MemoryPoolMXBeanImpl.java:235)
        at com.taobao.arthas.core.command.monitor200.MemoryCommand.getUsage(MemoryCommand.java:82)
        at com.taobao.arthas.core.command.monitor200.MemoryCommand.memoryInfo(MemoryCommand.java:52)
        at com.taobao.arthas.core.command.monitor200.DashboardCommand$DashboardTimerTask.run(DashboardCommand.java:245)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)

怀疑是和openj9的兼容问题 注:当openj9使用默认gc策略时无此报错

回答

9

openjdk8 也有类似问题

illegalArgumentCount:  1, number is: -185642, need >= 2
illegalArgumentCount:  2, number is: -113641, need >= 2
illegalArgumentCount:  3, number is: -156348, need >= 2
illegalArgumentCount:  4, number is: -43872, need >= 2
56921=56921
27821=43*647
183535=5*11*47*71
illegalArgumentCount:  5, number is: -151189, need >= 2
...
3

目前只保证支持 openjdk 系列。

0

这是math-game demo项目的输出