RFR: 8256916: Add JFR event for OutOfMemoryError

Yasumasa Suenaga ysuenaga at openjdk.java.net
Wed Dec 2 09:06:57 UTC 2020


On Wed, 2 Dec 2020 07:19:19 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:

>> @egahlin Is this answer sufficient for you about OOM handling? All comments are welcome.
>
> I think there is a use case for getting an event when an OOM occurs, but the long term plan is to change so that a jdk.JavaErrorThrow is emitted when the exception is thrown, not when the object is allocated. When that is fixed, it will take care of OOME automatically - at all places. I think it is confusing for users to not get an event at every OOME and users/customers will file bugs.

Why OOME is not reported?
I guess it is hard corded at `ThrowableTracer::traceError`. If it is correct, because it is implemented in Java? (JFR code in Java might not be work when OOME happens)

`ErrorThrownEvent` has description that says OutOfMemoryErrors are ignored, and also OOM in metaspace is reported in other event (`MetaspaceOOM`). So I think we can report OOM other than `jdk.JavaErrorThrow` now until "long term plan" is realized.

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

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


More information about the hotspot-dev mailing list