RFR: 8271931: Make AbortVMOnVMOperationTimeout more resilient to OS scheduling [v2]

Aleksey Shipilev shade at openjdk.java.net
Sat Aug 7 05:45:27 UTC 2021

On Fri, 6 Aug 2021 16:02:27 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> src/hotspot/share/runtime/vmThread.cpp line 93:
>>> 91:     fatal("%s VM operation took too long: completed in " JLONG_FORMAT " ms (timeout: " INTX_FORMAT " ms)",
>>> 92:           _vm_op_name, vm_op_duration, AbortVMOnVMOperationTimeoutDelay);
>>> 93:   }
>> Should we null `_vm_op_name` here?
> It's not read by anyone from here on, so setting it to null is not needed, and a waste of the VM thread time.

My concern would be holding the pointer to something that is already unallocated long after VM op completes. I guess it is a lower risk for `const char*`, which is probably a reference to globally available string, but anyway. The overhead argument does not seem very relevant here, as we do other stuff in this handler when it is enabled. It is not a waste in default VM mode.


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

More information about the hotspot-runtime-dev mailing list