On Mon, 19 May 2025 11:05:59 GMT, Guoxiong Li <g...@openjdk.org> wrote:

>> The one inside the safepoint will print sth 
>> `log_info(gc)("GCOverheadLimitThreshold ...`. There can be multiple 
>> concurrent mutators reaching here; printing here is undesirable.
>> 
>> I don't think throwing OOM, from gc's perspective, is an "error".
>
>> I don't think throwing OOM, from gc's perspective, is an "error".
> 
> Nevermind; I just obey the statement in methods 
> `MemAllocator::Allocation::check_out_of_memory` and 
> `Universe::out_of_memory_error_java_heap`.

Returning `null` outside of a safe point does have unexpected negative effects. 
e.g. `HeapDumpOnOutOfMemoryError` may not get good heap dump, as other threads 
can come in and run additional GCs, then the heap dump may contain confusingly 
little live data.

I wonder if you can improve this situtation.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25000#discussion_r2181262727

Reply via email to