RFR: 8278125: Some preallocated OOMEs are missing stack trace [v2]

Coleen Phillimore coleenp at openjdk.java.net
Wed Dec 15 16:55:59 UTC 2021


On Sat, 4 Dec 2021 18:50:19 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Universe::is_out_of_memory_xx
>
> src/hotspot/share/memory/universe.cpp line 597:
> 
>> 595:   const char * msg_str = java_lang_String::as_utf8_string(msg_oop);
>> 596:   return strcmp(msg, msg_str) == 0;
>> 597: }
> 
> Yes, I agree with David about strcmp.  Could you add this instead (it was trying to compare the oops for equality, and unintentionally generated a new one).
> 
> oop Universe::is_out_of_memory_error_metaspace(oop exception) {
>   return out_of_memory_errors()->obj_at(_oom_metaspace)) == exception;
> }

Ok, I see how this isn't right, but I still don't like the strcmp.  Can the string be interned and checked for equality?  Otherwise you also need a ResourceMark here.

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

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


More information about the hotspot-runtime-dev mailing list