On Fri, 19 Nov 2021 02:29:33 GMT, Stuart Marks <sma...@openjdk.org> wrote:

>>> When the finalization is disabled, perhaps jcmd GC.finalizer_info should 
>>> just be made as a nop in the VM.
>> 
>> Yes that is a trivial change to add. @stuart-marks I can provide the code. 
>> You can choose whether to include in this PR or else we can do a follow-up.
>
>> > When the finalization is disabled, perhaps jcmd GC.finalizer_info should 
>> > just be made as a nop in the VM.
>> 
>> Yes that is a trivial change to add. @stuart-marks I can provide the code. 
>> You can choose whether to include in this PR or else we can do a follow-up.
> 
> Seems simple enough. Is there any testing that needs to be done for this? 
> Does jcmd output require CSR review? I guess there would be a compatibility 
> issue if there were something that was parsing the output of jcmd. Or is it 
> solely intended to be read by humans?

@stuart-marks No CSR needed for this as no output format is specified. Plus 
this command already has a simple text response when there are no finalizers 
queued. E.g.
``` 
> ../build/linux-x64-debug-finalization/images/jdk/bin/jcmd 27939 
> GC.finalizer_info
27939:
No instances waiting for finalization found

so when finalization is disabled this just becomes:
``` 
> ../build/linux-x64-debug-finalization/images/jdk/bin/jcmd 28018 
> GC.finalizer_info
28018:
Finalization is disabled

There is a test for this Dcmd, but it doesn't test the "nothing here" case so I 
don't think it is necessary to augment it for this case:
`hotspot/jtreg/serviceability/dcmd/gc/FinalizerInfoTest.java`

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

PR: https://git.openjdk.java.net/jdk/pull/6442

Reply via email to