RFR: 8364182: Add jcmd VM.properties command [v3]

Alan Bateman alanb at openjdk.org
Fri Jan 9 08:04:24 UTC 2026


On Thu, 8 Jan 2026 22:08:21 GMT, Larry Cable <duke at openjdk.org> wrote:

>> src/hotspot/share/services/attachListener.cpp line 308:
>> 
>>> 306: }
>>> 307: 
>>> 308: // Implementation of "properties -security" command.
>> 
>> We don't need this: the attach API provides some basic commands, but most of the time we use the "jcmd" attach api command, which runs a DiagnosticCommand.  That's how we attach and run VM.properties etc...
>> 
>> This makes your life easier, we don't need serializeSecurityPropertiesToByteArray(), just updated DCmd and register_DCMDFactory lines.
>> (you'll need to merge in the later repo changes and resolve the register_DCMDFactory changes)
>
> I agree, this functionality should probably be added to the existing VM.system_properties jcmd as an option (if necessary)

Just some more history there. The reason the attachListener knows about the system properties command is because it dates back to JDK 6 when we introduced the attach mechanism and the Attach API. The Attach API defines VirtualMachine::getSystemProperties so both the tool and VM know about this "command". This all pre-dates jcmd and the diagnostic command framework that has been added since then.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29124#discussion_r2675223455


More information about the core-libs-dev mailing list