Questions tagged [jcmd]

jcmd utility is used to send diagnostic command requests to a running Java Virtual Machine (JVM). Like when you need stack trace, heap dump, vm arguments, system properties etc.

Below are official links for more details on jcmd

https://docs.oracle.com/javase/8/docs/technotes/tools/windows/jcmd.html https://docs.oracle.com/javase/9/tools/jcmd.htm

48 questions
1
vote
0 answers

How to get jvm heap dumps if the working directory is read only?

In my kubernetes application, I am running a java application from a readOnly root directory (ReadOnly root is a must). I do have a mount (folder) that is writable, however when I run: jmap -dump:live,format=b,file=/dumps/temp/dump.hprof 1 I get…
Dhruva
  • 11
  • 2
1
vote
1 answer

Java Heapdump - jsm -all GC.heap_dump

There is no -all option for jcmd command as per documentation. https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr006.html execute jcmd with -all option. GC is not triggered and can not see [Full GC (Heap Dump Initiated…
Nitul
  • 997
  • 12
  • 35
1
vote
1 answer

Java Heap committed memory is bigger than -Xmx

I am trying to hunt the memory leak in Java Spring Boot app inside docker container. Heap size of the app is limited like this: java -XX:NativeMemoryTracking=summary -jar /app-0.1.jar -Xms256m -Xmx512m Native memory diff looks like this: ./jcmd 7…
Ivan Jovović
  • 5,238
  • 3
  • 29
  • 57
1
vote
1 answer

Running jcmd in k8 pod, permission denied or unable to open socket file

For pod with java application there is security context: spec: securityContext: runAsUser: 888 runAsGroup: 888 fsGroup: 888 Deployment manifest: apiVersion: apps/v1 kind: Deployment metadata: name: springboot-demo spec: replicas:…
r4sk01
  • 15
  • 4
1
vote
1 answer

On Linux, some jcmd commands cannot be used

some jcmd parameters are available on macos or windows, but not on Linux, such as VM.metaspace. If I want to use this parameter in Linux, what should I do? My JDK versions are all 11
colin xun
  • 34
  • 5
1
vote
0 answers

jcmd's VM.command_line option becomes unavailable after restarting JavaVM (1.8.0_222)

In order to get the application start command of JavaVM (1.8.0_222) running in the server (based on RHEL7 / CentOS7), add jcmd (jdk1.8.0_66) with VM.command_line option as shown below (1 per minute). Running (continuously) times. "jcmd {process ID}…
1
vote
0 answers

jcmd's VM.command_line option available over time

I am running jcmd with the VM.command_line option as shown below To get the JavaVM startup command running in the server. jcmd {proccessId} VM.command_line This will return the following error over…
1
vote
0 answers

Create JVM heap dump of tomcat service running on Window

While trying to create a heap dump from a Tomcat Service running as windows service, get "Access is denied" error. I started the command prompt as "Run as Administrator" Erorr while using jmap and jcmd How do I get rid of "Access is denied" or is…
Raja
  • 11
  • 1
1
vote
1 answer

Command VM.native_memory not recognized for java process started with -XX:NativeMemoryTracking=summary

My environment is MacOs + Java 11: java -version openjdk version "11.0.8" 2020-07-14 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10) Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.21.0, JRE 11 Mac OS X amd64-64-Bit Compressed References…
codependent
  • 23,193
  • 31
  • 166
  • 308
1
vote
1 answer

Java Native memory usage does not match the total virtual memory used

I have a Java app which use a lot of memory off heap, more than expected. Native memory tracking says that the app uses 14 GB but from the informations obtained with top the app uses 25.6 GB of virtual memory. What is this difference due to? > jcmd…
Lorenzo Belli
  • 1,767
  • 4
  • 25
  • 46
1
vote
1 answer

Can cause STW when execute jcmd GC.class_stats?

I'm gonna execute jcmd $PID GC.class_stats -csv=true command on my tomcat process, to get loaded class status. I worry about the command effect to tomcat process, like creating heap dump. Can cause stop the world or the other effect when execute the…
SHRIN
  • 318
  • 3
  • 15
1
vote
0 answers

jhat -baseline feature does not work with HeapDumpOnOutOfMemoryError and jcmd GC.heap_dump generated baseline

I have a sudden memory leak which occurs fairly instantaneously so I must catch the dump with HeapDumpOnOutOfMemoryError. But to see what really caused this massive memory spike I need to take a baseline first, and I use jcmd $pid GC.heap_dump…
Gunther Schadow
  • 1,490
  • 13
  • 22
1
vote
1 answer

Getting the average size of a specific class from a running JVM

I'm trying to get the average size of all instances of a certain class in a running JVM. I can create a heap dump with jcmd or similar but that takes a few seconds and this is a production server so I'd rather have something faster. jcmd has an…
Johnny
  • 7,073
  • 9
  • 46
  • 72
1
vote
2 answers

Running jcmd using JDK-11 on JDK-8 java process not running successfully

I am trying to monitor native memory of tomcat using jcmd but getting following exception: Command: jcmd 14533 VM.native_memory summary I have installed 2 jdk's jdk-11 AND jdk-8. Tomcat is running by jdk-8 and jcmd used jdk-11 then i…
1
vote
1 answer

Java native memory tracking heap committed much more than total from heap dump

Using jdk1.8.0_152 I am trying to track down what part of my java program is using the most memory (mainly in the heap) Using top I see that the whole process is using around 1.109G of residual memory Using jcmd {PID} VM.native_memory I see that the…
markk
  • 607
  • 1
  • 7
  • 11