RFR: 8224479: New diagnostic command: VM.get_flag

Thomas Stüfe thomas.stuefe at gmail.com
Tue May 21 13:25:33 UTC 2019


On Tue, May 21, 2019 at 3:22 PM Stefan Karlsson <stefan.karlsson at oracle.com>
wrote:

> Hi Thomas,
>
> On 2019-05-21 12:37, Thomas Stüfe wrote:
> > I think this is useful.
>
> Thanks.
>
> I have a vague preference for reusing VM.flags
> > though - giving it the option to only print one flag - instead of adding
> > a new command.
>
> So, we would have three different modes for VM.flags:
> $ jcmd HelloSleep VM.flags
> 371:
> -XX:CICompilerCount=15 -XX:ConcGCThreads=6
> -XX:G1ConcRefinementThreads=23 -XX:G1HeapRegionSize=4194304
> -XX:GCDrainStackTargetSize=64 -XX:InitialHeapSize=2113929216
> -XX:MarkStackSize=4194304 -XX:MaxHeapSize=32178700288
> -XX:MaxNewSize=19306381312 -XX:MinHeapDeltaBytes=4194304
> -XX:NonNMethodCodeHeapSize=8182140 -XX:NonProfiledCodeHeapSize=121738050
> -XX:ProfiledCodeHeapSize=121738050 -XX:ReservedCodeCacheSize=251658240
> -XX:+SegmentedCodeCache -XX:+UseCompressedClassPointers
> -XX:+UseCompressedOops -XX:+UseFastUnorderedTimeStamps -XX:+UseG1GC
>
> $ /localhome/java/jdk9/bin/jcmd HelloSleep VM.flags -all
> 371:
> [Global flags]
> ccstrlist AOTLibrary                               =
>                        {product} {default}
>        int ActiveProcessorCount                     = -1
>                         {product} {default}
>      uintx AdaptiveSizeDecrementScaleFactor         = 4
>                         {product} {default}
>      uintx AdaptiveSizeMajorGCDecayTimeScale        = 10
>                         {product} {default}
>      uintx AdaptiveSizePolicyCollectionCostMargin   = 50
>                         {product} {default}
>
> and a new mode:
> $ /localhome/java/jdk9/bin/jcmd HelloSleep VM.flags -name=UseSerialGC
> 371:
>       bool UseSerialGC                              = false
>                         {product} {default}
>
> Let's see if anyone else has some feedback regarding this.
>
> Thanks,
> StefanK
>
>
As I write, slight preference only. If others like VM.get_flag more, I am
fine with that too, since it complements the existing VM.set_flag.

..Thomas


> >
> > Just my 5c
> >
> > .. Thomas
> >
> > On Tue, May 21, 2019, 12:14 Stefan Karlsson <stefan.karlsson at oracle.com
> > <mailto:stefan.karlsson at oracle.com>> wrote:
> >
> >     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
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20190521/5d24b839/attachment.html>


More information about the serviceability-dev mailing list