RFR: 8224479: New diagnostic command: VM.get_flag

Stefan Karlsson stefan.karlsson at oracle.com
Tue May 21 10:14:03 UTC 2019


Hi all,

Please review this patch to introduce a new diagnostic command: VM.get_flag.

http://cr.openjdk.java.net/~stefank/8224479/webrev.01/
https://bugs.openjdk.java.net/browse/JDK-8224479

Today we have:

- VM.set_flag - which allows the user to set a manageable flag
- VM.flags - which allows the user to print all set flags or print 
similar output as -XX:+PrintFlagsFinal

I propose that we add a new command to print the value of one flag.

Output from help:
==========
$ jcmd HelloSleep help VM.get_flag
1060:
VM.get_flag
Prints the value of a VM flag option.

Impact: Low

Permission: java.lang.management.ManagementPermission(monitor)

Syntax : VM.get_flag  <flag name>

Arguments:
	flag name :  The name of the flag we want to get (STRING, no default value)
==========

Output from usage:
==========
$ jcmd HelloSleep VM.get_flag UseSerialGC
1060:
false
==========

I'll create a CSR if others also thinks this is a worthwhile feature.

Thanks,
StefanK


More information about the serviceability-dev mailing list