ResourceExhausted JVMTI event and -XX:*OnOutOfMemoryError

Yasumasa Suenaga yasuenag at gmail.com
Tue Jul 23 07:24:14 UTC 2019


Hi all,

I tried to use JVMTI agent which hooks ResourceExhausted event and -XX:ExitOnOutOfMemoryError together.
The process was exited when OutOfMemoryError was occurred, but ResourceExhausted event was not fired.

I checked HotSpot implementation, -XX:*OutOfMemoryError is processed before JVMTI event processing.

http://hg.openjdk.java.net/jdk/jdk/file/d999a1a11485/src/hotspot/share/gc/shared/memAllocator.cpp#l125

IMHO ResourceExhausted should be called before -XX:*OutOfMemoryError.
If it is a bug, I will file it to JBS and fix it.


Thanks,

Yasumasa



More information about the hotspot-gc-dev mailing list