8296463: Memory leak in JVM_StartThread with the integration of Virtual threads

Reviewed-by: thartmann
Backport-of: 7b3984cb5a08edb99a233c28331c00b25457d664
This commit is contained in:
David Holmes 2022-11-28 07:22:07 +00:00
parent 94de334f8c
commit 0959a6538a

View File

@ -1229,10 +1229,11 @@ JavaThread::JavaThread(ThreadFunction entry_point, size_t stack_sz) : JavaThread
JavaThread::~JavaThread() {
// Ask ServiceThread to release the threadObj OopHandle
// Ask ServiceThread to release the OopHandles
ServiceThread::add_oop_handle_release(_threadObj);
ServiceThread::add_oop_handle_release(_vthread);
ServiceThread::add_oop_handle_release(_jvmti_vthread);
ServiceThread::add_oop_handle_release(_extentLocalCache);
// Return the sleep event to the free list
ParkEvent::Release(_SleepEvent);