Relates :
|
|
Relates :
|
|
Relates :
|
- - (This bug has been marked with lower priority as the leak is benign.) Certain ResourceObjs are being allocated on the C heap using the ResourceObj::C_HEAP argument to operator new without being properly freed. operator delete for ResourceObj is a no-op, so the storage for such objects must be freed after calling delete on the passed pointer by calling FreeHeap on it as well. For example: my_ptr = new (ResourceObj::C_HEAP) MyClass(); ... delete my_ptr; FreeHeap(my_ptr); This idiom is used for example in Label::free() in assembler.hpp. Most of the allocations of this type are for GrowableArrays being allocated on the C heap. For these objects clear_and_deallocate() must be called before freeing the storage. This is already being done in most places but there are a few omissions. In some places the call of operator delete has been elided. This is not incorrect, but for consistency such allocation sites should be changed to follow the pattern in Label::free() (clear_and_deallocate, delete, FreeHeap). The relevant allocation sites for this group's code are attached. hotspot/compiler2: c2_baseline/src/share/vm/compiler/compileLog.cpp:19: initialize(new(ResourceObj::C_HEAP) fileStream(fp)); - _out is leaked in destructor hotspot/compiler2: src/share/vm/compiler/compileLog.cpp:19: initialize(new(ResourceObj::C_HEAP) fileStream(fp)); - _out is leaked in destructor
|