Skip to content

Commit b3f7d38

Browse files
authored
fix(liveness): release jweak ref when liveness table overflows or realloc fails (#556)
1 parent 45e1535 commit b3f7d38

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

ddprof-lib/src/main/cpp/livenessTracker.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,10 @@ void LivenessTracker::track(JNIEnv *env, AllocEvent &event, jint tid,
370370
} else {
371371
Log::debug("Cannot add sampled object to Liveness tracking table, it's "
372372
"overflowing");
373+
env->DeleteWeakGlobalRef(ref);
373374
}
375+
} else {
376+
env->DeleteWeakGlobalRef(ref);
374377
}
375378
}
376379
skipped = 0; // reset the subsampling skipped bytes

0 commit comments

Comments
 (0)