RFR: 8256916: Add JFR event for OutOfMemoryError

Yasumasa Suenaga ysuenaga at openjdk.java.net
Mon Dec 21 01:36:59 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.

@egahlin OOME from JVM will not be reported because they are instantiated at JVM init stage and are kept in `Universe`, so they cannot be handled in `ThrowableTracer::traceError`.
We can trace OOMEs which are happened in Java code at `ThrowableTracer::traceError`. However I'm not sure where the event should be handled in.

For sake of simply, I want to add `jdk.OutOfMemoryError` event to `jdk.jfr` module as a Java class, and I want to emit it from `ThrowableTracer::traceError`, however it duplicates with a definition in JVM.
OTOH we can implement to emit event from `ThrowableTracer::traceError` via `JVM` class, however need to add API to emit events with arbitrary arguments.

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

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


More information about the hotspot-dev mailing list