JDK-8336684 : Enhance JCmd by adding a new command to summarize target r/t metadata
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: tools
  • Priority: P4
  • Status: Resolved
  • Resolution: Rejected
  • OS: generic
  • CPU: generic
  • Submitted: 2024-07-17
  • Updated: 2024-12-11
  • Resolved: 2024-12-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
CSR :  
Relates :  
Description
there are existing jcmds that (partially) summarize target JVM invocation metadata e.g:
- VM.Version
- VM.Uptime
- VM.Command_line
- VM.Flags
- VM.Info
- ...

many agents and other tools collect and potentially log this metadata, however having the metadata currently implemented by multiple JCmds is
for some use cases non-optimal requiring multiple jcmd round trips to collect.

a new Jcmd that summarizes (in a single operation):
- JVM start time/uptime
- JVM process id
- JVM/JDK version info
- location of JAVA_HOME/JDK
- class path
- module path (if set) (and any other module metadata)
- java command program arguments
-  jvm command line options/flags
- any loaded agents
- status of mgmt agent 
- ...

this would enable a tool to capture the invocation state of the target JVM in a single operation (optionally appending it to a specified file)

Comments
[~alanb] believes that this jcmd is unnecessary and duplicative of existing jcmd and JMX functionality.
11-12-2024

going to investigate populating System properties with some of these values as an alternative
20-11-2024

thinking about the design of the command, there could be a "format" (or "metadata") parameter which would consist of a list of "metadata" keys, e.g: - start - pid - version - javahome - classpath - modulepath - vmargs - args - ... jcmd <pid> VM.summary metadata=startTime,pid,javahome,versions,classpath,args if metadata is not specific a default format is used.
17-07-2024

note this is effectively "Java Usage Tracker" for OpenJDK but requires external stimuli (the jcmd client) to attach in order to elicit the collection of the metadata.
17-07-2024