The 

[JDK-8213834](https://bugs.openjdk.org/browse/JDK-8213834) JVMTI 
ResourceExhausted should not be posted in CompilerThread

disables  posting ResourceExhausted events on CompilerThread because it can't 
post event. 
The ResourceExhausted is used by agents to identify VM issues (and usually kill 
instance). I think it makes sense to generate this event on the ServiceThread 
like other deferred events (methods loading/unloading). 
So tool like https://github.com/Netflix-Skunkworks/jvmquake can properly kill 
jvm if resource exhausting happens on any thread.

Please note, that ResourceExhausted is NOT generated when CodeCache full. It 
might be makes sense to add it since performance degradation going to be 
critical and makes sense treat CodeCache as a resource.

It is hard generate OOME in the CompilerThread to test this fix.

The fix was tested by patch that generated event for codecache exchausting and 
new test. 
https://github.com/openjdk/jdk/compare/master...lmesnik:jdk:codecache-full?expand=1

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

Commit messages:
 - 8214294: Post ResourceExhausted events generated by CompilerThread on the 
ServiceThread

Changes: https://git.openjdk.org/jdk/pull/29397/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29397&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8214294
  Stats: 47 lines in 3 files changed: 37 ins; 5 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/29397.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29397/head:pull/29397

PR: https://git.openjdk.org/jdk/pull/29397

Reply via email to