mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
7066129: GarbageCollectorMXBean#getLastGcInfo leaks native memory
Make GCStatInfo a resource object Reviewed-by: phh, coleenp
This commit is contained in:
parent
d0b33ef971
commit
501bad4fd6
4 changed files with 13 additions and 12 deletions
|
@ -44,7 +44,8 @@ void GCNotifier::pushNotification(GCMemoryManager *mgr, const char *action, cons
|
|||
// Make a copy of the last GC statistics
|
||||
// GC may occur between now and the creation of the notification
|
||||
int num_pools = MemoryService::num_memory_pools();
|
||||
GCStatInfo* stat = new GCStatInfo(num_pools);
|
||||
// stat is deallocated inside GCNotificationRequest
|
||||
GCStatInfo* stat = new(ResourceObj::C_HEAP) GCStatInfo(num_pools);
|
||||
mgr->get_last_gc_stat(stat);
|
||||
GCNotificationRequest *request = new GCNotificationRequest(os::javaTimeMillis(),mgr,action,cause,stat);
|
||||
addRequest(request);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue