RFR: 8256916: Add JFR event for OutOfMemoryError
Yasumasa Suenaga
ysuenaga at openjdk.java.net
Tue Feb 16 08:29:39 UTC 2021
On Tue, 19 Jan 2021 01:35:20 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:
>> As you say: "move throwing events into HotSpot makes big change" - I agree and Erik has already stated that many have tried already to make this kind of change, but attempts have faltered because the impact / disruptions are unclear. Do you fully understand the consequences of how it will change the way users work with exceptions in JFR? If C2 optimizations now start to remove exception sites that were previously reported?
>>
>> I understand and appreciate the ambition, and I acknowledge the existing mechanisms has drawbacks (known for a long time) but reworking how exceptions are reported is a big project. Such a project should also involve exception throttling - and throttling might pose additional constraints / opportunities that need to be considered.
>>
>> Modifying this subsystem is a sensitive undertaking and should solve the fundamental and already known problems before it is to be endorsed and for the disruption to end user motivated.
>
>> As you say: "move throwing events into HotSpot makes big change" - I agree and Erik has already stated that many have tried already to make this kind of change, but attempts have faltered because the impact / disruptions are unclear. Do you fully understand the consequences of how it will change the way users work with exceptions in JFR? If C2 optimizations now start to remove exception sites that were previously reported?
>
> I believe the user who hooks JavaErrorThrow event wants to know the occurrence of OOME.
> Let's think about the user who want to restart the system automatically if the fatal error happens.
> The user defines OOME as an event that should be restarted and monitored by remote recording. If JavaErrorThrow event for OOME cannot be hooked, it is meaningless.
>
> I understand all `Throwable` s cannot be hooked due to C2 optimization, but most of them should be hooked. They should be hooked as well as unified logging at least, and we can do it like this PR.
I said in before, it is big change, but JFR should hook exceptions as possible like unified logging with `exceptions` tag.
I understand some exceptions cannot be hooked due to JIT compilation in this discussion, but even if so, it is a problem that JFR cannot hook various exceptions which are thrown in HotSpot.
Again, I understand to fix this problem is very difficult, but we should work for it as possible, or we cannot analyze the relation between exceptions and various metrics in flight record.
Of course I agree to separate to smaller fix.
Anyway, I want to record exceptions in JFR. It is a problem not to be able to hook critical errors such as OutOfMemoryError and StackOverflowError.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1403
More information about the hotspot-jfr-dev
mailing list