7066129: GarbageCollectorMXBean#getLastGcInfo leaks native memory

Make GCStatInfo a resource object

Reviewed-by: phh, coleenp
This commit is contained in:
Dmitry Samersoff 2012-01-25 02:29:05 +04:00
parent d0b33ef971
commit 501bad4fd6
4 changed files with 13 additions and 12 deletions

View file

@ -214,8 +214,8 @@ GCMemoryManager::~GCMemoryManager() {
void GCMemoryManager::initialize_gc_stat_info() {
assert(MemoryService::num_memory_pools() > 0, "should have one or more memory pools");
_last_gc_stat = new GCStatInfo(MemoryService::num_memory_pools());
_current_gc_stat = new GCStatInfo(MemoryService::num_memory_pools());
_last_gc_stat = new(ResourceObj::C_HEAP) GCStatInfo(MemoryService::num_memory_pools());
_current_gc_stat = new(ResourceObj::C_HEAP) GCStatInfo(MemoryService::num_memory_pools());
// tracking concurrent collections we need two objects: one to update, and one to
// hold the publicly available "last (completed) gc" information.
}