On Thu, 10 Sep 2026 13:08:11 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). > > Kieran Farrell has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 12 commits: > > - Merge master > - refactor > - split to internal method > - revert mistaken change > - add comment and update print_properties to use CHECK > - remove validation > - extend test coverage and code clean up > - updates > - clean up and add test > - synthax alignmnet > - ... and 2 more: https://git.openjdk.org/jdk/compare/010428f5...f29804f0 The original implementation for the -Xshowsettings launch command is based around getting a live snapshot of the relative values but is taken at start-up. With regards to the jcmd if we wanted to keep all data points consisitent in terms of being current or initial, converting all of these to get an initial snapshot could be tricky, though maybe we could capture and store these on start up to be called upon by jcmd. If you mean just return the initial values of the security and system properties and keep the rest as current, this would be much easier as both are already stored individually but it might be a little confusing to the developer to be presented with a mix of data points from both points in time? though I do agree whichever way we go it should be made clearer. In revising the code I noticed the initial security properties are returned rather than the current values (all other data points are the current values as it stands), so I've pushed a commit changing those to the current values along with some more info to the jcmd output as a starting point. ------------- PR Comment: https://git.openjdk.org/jdk/pull/31742#issuecomment-5720060179
