Summary
Extend jcmd vm selection syntax to allow wildcards.
Problem
For jcmd, vmid resolution on the command line can feel a bit strange.
One can give the program name (which is the name of the main class or the name of the jar file) instead of pid which is a very nice feature.
One can also give it part of a program name to select multiple running VMs - e.g. as in
jcmd com.test
would select all processes running classes or jar files whose name contains "com.test".
But there is no way to just select all processes on the machine. Nor is there a way to specify prefix or suffix matching. And finally, at least for me, the syntax is a bit surprising: I would have expected wildcards.
So, to select all processes running on a box, I usually do this:
jcmd .
since the dot '.' usually occurs in almost any program name for any running VM. But that just feels wrong.
Solution
1) Extend the command line syntax of jcmd such that program names can be suffixed with '*':
jcmd 'test.*'
would select all processes whose program names start with "test.".
2) Less important but complementing (1): Extend the command line syntax of jcmd such that program names can be prefixed with '*':
jcmd '*Test.java'
would select all processes whose program names end with "Test.java".
3) Finally, a singular "*" should mean "select all processes"
jcmd '*'
- This addition to the syntax can be put atop the existing syntax:
jcmd com.test
should continue to work and be equivalent to
jcmd '*com.test*'
- This change would have to be completely done in the jcmd client and, of course, not require any change in the hotspot. So a new client with this new syntax should immediately work with all existing VMs.
Specification
No implementation yet.
- csr of
-
JDK-8204594 Improve jcmd VM selection in the command line
-
- Closed
-
- relates to
-
JDK-8177064 jcmd help command should not require the process identification
-
- Closed
-