<div dir="ltr"><div dir="ltr"><div>I am very much in favor of printing all flags, for the reasons Frederic has given. When one supports many different releases, it is a huge timesaver not to have to look up flags but see them right there in the customer logs. The ability of PrintFlagsFinal to give me all flags, including default values, after they are resolved to their final values, is also very useful during development.</div><div><br></div><div>For simplicity, I would prefer just to change the behavior of PrintFlagsFinal to do that, but I could live with a new PrintAllFlagsFinal.</div><div><br></div><div>Number of normal flags: 513, incl. diagnostic: 777, incl. experimental&diagnostic: 933. (Jdk 25). So, it's a bit more. I am not bothered by this, since this list never fits onto a single screen anyway. People grep. But if others prefer an extra flag, sure, let's have one.</div><div></div><div><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Nov 27, 2025 at 3:05 AM David Holmes <<a href="mailto:david.holmes@oracle.com">david.holmes@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 27/11/2025 12:53 am, Frederic Thevenet wrote:<br>
> Hi,<br>
> <br>
> Currently, using +PrintFlagsFinal prints out all JVM flags and their <br>
> values, even if they were not modified from their default, except for <br>
> 'locked' flags, i.e. Experimental and Diagnotic flags. In order to have <br>
> those printed out as well, one must first 'unlock' them (with <br>
> +UnlockExperimentalVMOptions, for instance).<br>
<br>
I think this was simply a pragmatic decision to avoid overwhelming the <br>
user with information that should not be relevant.<br>
> Now, is their a strong reason for not always displaying the default <br>
> values for those in scenarios were there is no concerns that the output <br>
> might be too large (that is when calling upon 'JVMFlag::printFlags' with <br>
> 'skipDefaults' set to false, like PrintFlagsFinal does)?<br>
> <br>
> The reason for this question is that when chasing a bug in scenarios <br>
> where one can only rely on logs or output provided by tools that uses <br>
> +PrintFlagsFinal, getting the default values *in the conditions that <br>
> those logs where produced* can be tricky as it depends on the exact <br>
> version of the JDK that was running, and some values can be changed by <br>
> ergonomics.<br>
<br>
Ouch. I think that would be a poor design choice for diagnostic, and <br>
especially experimental flags!<br></blockquote><div><br></div><div>Not every experimental/diagnostic flag is a boolean that defaults to false and controls an opt-in feature. We have non-boolean experimental flags and boolean flags that default to true. It is not unthinkable that those are changed during VM start.</div><div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> If you need to know the default for experimental flags -- which given <br>
> their nature can and do change often -- your choices are to either ask <br>
> for these logs to be generated again using +UnlockExperimentalVMOptions <br>
> (even if there is no intention of changing an experimental flag) or to <br>
> go on a time consuming deep dive into the code base for the exact <br>
> version of the JDK that was used. Neither is ideal.<br>
<br>
True, but for experimental flags in particular, unless you are deep <br>
diving into the code how can you know whether a particular flag and its <br>
value are relevant to your debugging in the first place?<br></blockquote><div><br></div><div>I think the point here is reducing analyst strain. It's not that it is impossible to get the information otherwise, but that it's convenient and stress-reducing to have one sure way to look up all resolved flag values for a customer's JVM run. Folks who have to work with many cases involving different JVM versions would value this.</div><div><br></div><div>BTW, we do print default values for non-experimental non-diagnostic flags, too. The same reasoning applies here: if its not changed, you could look up the default value.</div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
That said, I don't see any harm in providing a way to print all flags, <br>
though whether by default or by a new -XX:PrintAllFlagsFinal flag, I'm <br>
not sure.<br><br></blockquote><div><br></div><div>Wonderful, let's do that then. </div><div><br></div><div>Cheers, Thomas </div></div></div>