mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8213834: JVMTI ResourceExhausted should not be posted in CompilerThread
Reviewed-by: dholmes, dcubed, jcbeyler, sspitsyn
This commit is contained in:
parent
23ecdbbc1d
commit
abf1e47f29
1 changed files with 12 additions and 1 deletions
|
@ -1483,6 +1483,18 @@ void JvmtiExport::post_object_free(JvmtiEnv* env, jlong tag) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void JvmtiExport::post_resource_exhausted(jint resource_exhausted_flags, const char* description) {
|
void JvmtiExport::post_resource_exhausted(jint resource_exhausted_flags, const char* description) {
|
||||||
|
|
||||||
|
JavaThread *thread = JavaThread::current();
|
||||||
|
|
||||||
|
// JDK-8213834: handlers of ResourceExhausted may attempt some analysis
|
||||||
|
// which often requires running java.
|
||||||
|
// This will cause problems on threads not able to run java, e.g. compiler
|
||||||
|
// threads. To forestall these problems, we therefore suppress sending this
|
||||||
|
// event from threads which are not able to run java.
|
||||||
|
if (!thread->can_call_java()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
EVT_TRIG_TRACE(JVMTI_EVENT_RESOURCE_EXHAUSTED, ("Trg resource exhausted event triggered" ));
|
EVT_TRIG_TRACE(JVMTI_EVENT_RESOURCE_EXHAUSTED, ("Trg resource exhausted event triggered" ));
|
||||||
|
|
||||||
JvmtiEnvIterator it;
|
JvmtiEnvIterator it;
|
||||||
|
@ -1490,7 +1502,6 @@ void JvmtiExport::post_resource_exhausted(jint resource_exhausted_flags, const c
|
||||||
if (env->is_enabled(JVMTI_EVENT_RESOURCE_EXHAUSTED)) {
|
if (env->is_enabled(JVMTI_EVENT_RESOURCE_EXHAUSTED)) {
|
||||||
EVT_TRACE(JVMTI_EVENT_RESOURCE_EXHAUSTED, ("Evt resource exhausted event sent" ));
|
EVT_TRACE(JVMTI_EVENT_RESOURCE_EXHAUSTED, ("Evt resource exhausted event sent" ));
|
||||||
|
|
||||||
JavaThread *thread = JavaThread::current();
|
|
||||||
JvmtiThreadEventMark jem(thread);
|
JvmtiThreadEventMark jem(thread);
|
||||||
JvmtiJavaThreadEventTransition jet(thread);
|
JvmtiJavaThreadEventTransition jet(thread);
|
||||||
jvmtiEventResourceExhausted callback = env->callbacks()->ResourceExhausted;
|
jvmtiEventResourceExhausted callback = env->callbacks()->ResourceExhausted;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue