Skip to content
Permalink
Browse files
8273902: Memory leak in OopStorage due to bug in OopHandle::release()
Backport-of: bc48a0ac297b99a997482dcb59f85acc1cdb0c47
  • Loading branch information
Volker Simonis committed Sep 27, 2021
1 parent d46a5ae commit 926a815f6720211366478b6fcbf4a8d168750a31
Showing with 2 additions and 4 deletions.
  1. +1 −1 src/hotspot/share/oops/oopHandle.inline.hpp
  2. +1 −3 src/hotspot/share/prims/jvmtiImpl.cpp
@@ -48,7 +48,7 @@ inline OopHandle::OopHandle(OopStorage* storage, oop obj) :
}

inline void OopHandle::release(OopStorage* storage) {
if (peek() != NULL) {
if (_obj != NULL) {
// Clear the OopHandle first
NativeAccess<>::oop_store(_obj, (oop)NULL);
storage->release(_obj);
@@ -206,9 +206,7 @@ JvmtiBreakpoint::JvmtiBreakpoint(Method* m_method, jlocation location)
}

JvmtiBreakpoint::~JvmtiBreakpoint() {
if (_class_holder.peek() != NULL) {
_class_holder.release(JvmtiExport::jvmti_oop_storage());
}
_class_holder.release(JvmtiExport::jvmti_oop_storage());
}

void JvmtiBreakpoint::copy(JvmtiBreakpoint& bp) {

1 comment on commit 926a815

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 926a815 Sep 27, 2021

Please sign in to comment.