8301187: Memory leaks in OopMapCache

Reviewed-by: fparain, coleenp
This commit is contained in:
Justin King 2023-01-27 14:58:22 +00:00 committed by Coleen Phillimore
parent fccf818972
commit e2a3b20ca8

View File

@ -540,6 +540,7 @@ void OopMapCache::lookup(const methodHandle& method,
// at this time. We give the caller of lookup() a copy of the
// interesting info via parameter entry_for, but we don't add it to
// the cache. See the gory details in Method*.cpp.
tmp->flush();
FREE_C_HEAP_OBJ(tmp);
return;
}
@ -610,5 +611,6 @@ void OopMapCache::compute_one_oop_map(const methodHandle& method, int bci, Inter
tmp->initialize();
tmp->fill(method, bci);
entry->resource_copy(tmp);
tmp->flush();
FREE_C_HEAP_OBJ(tmp);
}