Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find VMID for running instance

I have a webapp running on tomcat and I want to look at garbage collection during runtime using jstat.

I have the command:

jstat.exe -gc <vmid> 1000

How can I find what the vmid is?

like image 829
Sionnach733 Avatar asked Nov 15 '25 19:11

Sionnach733


1 Answers

vmid is essentially a PID of JVM process

You have multiple options to find PID of your JVM

  • use generic OS tools such as ps
  • use jps tools from JDK
  • use more elaborate version of jps from SJK tools (i.e. it can display system properties of listed JVMs)
like image 168
Alexey Ragozin Avatar answered Nov 17 '25 11:11

Alexey Ragozin