$ jcmd -l
418 sun.tools.jcmd.JCmd -l
$ jstat -gcutil -t 10 250ms 1
10 not found
I am aware of the bug in jdk related to attaching jstat as root to a process running as a different user.
Here, this docker container has one user root and as can be seen below from the ps command, cassandra is running under root.
$ whoami
root
I have tried to do the following: $ sudo -u root jcmd -l
Any help is appreciated.
Docker container is debian:jessie running java version: openjdk version "1.8.0_66-internal"
Here's the output of ps -ef:
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 17:40 ? 00:00:00 /bin/bash /run.sh
root 10 1 11 17:40 ? 00:02:25 java -ea -javaagent:/usr/share/c
root 375 0 0 17:49 ? 00:00:00 bash
root 451 375 0 18:00 ? 00:00:00 ps -ef
Aside: jstack successfully dumps out the stack traces of the threads.
I know at least two possible reasons why this can happen.
-XX:+PerfDisableSharedMem
option. This option helps sometimes to reduce JVM safepoint pauses, but it also makes JVM invisible to jps
and jstat
. This is a very likely case, because you are running Cassandra, and recent Cassandra has this option ON by default./tmp
of Java process is not physically the same directory as /tmp
of your shell. The directory /tmp/hsperfdata_root
must be accessible in order to use jps
or jstat
. This is also a plausible reason since you are using docker containers.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With