RFR: 8278125: Some preallocated OOMEs are missing stack trace [v4]
Yi Yang
yyang at openjdk.java.net
Wed Dec 22 08:12:58 UTC 2021
> Our customer found that the PreallocatedOutOfMemoryErrorCount is 4 by default. It ought to pre-allocate 4 OOMEs with stack trace, but in fact, no matter how many OOMEs are thrown, only 2 OOMEs have proper stack trace. This is because PreallocatedOutOfMemoryErrorCount is consumed multiple times:
>
> VM tries to allocate a huge object while Java heap is insufficient to accommodate, it goes to:
>
> https://github.com/openjdk/jdk/blob/b79554bb5cef14590d427543a40efbcc60c66548/src/hotspot/share/gc/shared/memAllocator.cpp#L115-L136
>
> Line 135(`Universe::out_of_memory_error_java_heap`->`Universe::gen_out_of_memory_error`) and line 136(`THROW_OOP_`->`Exceptions::_throw`->`Exceptions::count_out_of_memory_exceptions`->`Universe::out_of_memory_error_java_heap`->`Universe::gen_out_of_memory_error`) call `Universe::gen_out_of_memory_error` twice in a single OOM event, which leads this unexpected scenario. Proposed fix is to remove such call in `Exceptions::count_out_of_memory_exceptions`.
>
> Thanks.
Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
preallocate oome message objects
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/6672/files
- new: https://git.openjdk.java.net/jdk/pull/6672/files/9e4ff230..b3f0e0e3
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6672&range=03
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6672&range=02-03
Stats: 56 lines in 3 files changed: 23 ins; 24 del; 9 mod
Patch: https://git.openjdk.java.net/jdk/pull/6672.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/6672/head:pull/6672
PR: https://git.openjdk.java.net/jdk/pull/6672
More information about the hotspot-runtime-dev
mailing list