VisualVM - 无法对CPU /内存进行采样

时间:2016-04-04 14:33:56

标签: java linux centos visualvm

我无法在VisualVM上使用该采样器。然而,我能够看到概述和远程监控。这是我的java应用程序启动脚本&一段视频,显示我遇到的问题。使用CentOS。

https://www.youtube.com/watch?v=w4jqH4x1Rzg

启动脚本

screen -d -m -S SG java -server -Xmx8G -Xms1G -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:MaxGCPauseMillis=30 -XX:+UseBiasedLocking -XX:+OptimizeStringConcat -XX:+UseFastAccessorMethods -XX:+AggressiveOpts -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8766 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -jar spigot.jar

错误消息

CPU sampling:
Not available. Cannot access threads in target application. Check the logfile for details (use Help | About | Logfile).

Memory sampling:
Not available. Failed to read objects in target application. Check the logfile for details (use Help | About | Logfile).

1 个答案:

答案 0 :(得分:1)

The issue were that I logged in as monitorRole instead of controlRole when connecting remotely.