On Wed, 1 Jul 2026 18:18:56 GMT, Kieran Farrell <[email protected]> wrote:

> This patch adds a new jcmd diagnostic command, `VM.show_settings`, to make 
> the existing -`XshowSettings` output available from a running VM. The command 
> accepts the same sections as`XshowSettings` (all, vm, properties, locale, 
> security, system, security:all, security:properties, security:providers, 
> security:tls). 
> 
> HotSpot registers the new diagnostic command, validates the requested 
> section, then calls into `sun.launcher.LauncherHelper` to reuse the existing 
> show settings formatting and return the result as bytes for the jcmd stream. 
> The VM settings path also passes hotspots `InitialHeapSize`, `MaxHeapSize`, 
> and Java thread stack size into the Java helper. A new jcmd test covers VM, 
> properties, security TLS, and invalid-input output.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/hotspot/share/services/diagnosticCommand.hpp line 874:

> 872:     return "Print information similar to -XshowSettings, e.g. "
> 873:            "'VM.show_settings locale' or 'VM.show_settings 
> security:tls'.";
> 874:   }

For the help, do we document all the options here, or say "See 'java -X' for 
the list of -XshowSettings options".

Similarly, in ShowSettingsDCmd::execute() do we need to verify all the section 
names, or can we leave that to the existing implementation?
If we can avoid maintaining this list in more than one place, that would be 
great.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/31742#discussion_r3512293522

Reply via email to