RFR (S): 8239070: Memory leak when unsuccessfully mapping in archive regions
ioi.lam at oracle.com
Fri Feb 14 16:08:45 UTC 2020
Thanks for fixing this issue. Freeing the array at each exit point seems
error prone. How about: refactoring the function to a
FileMapInfo::map_heap_data_impl function, allocate inside
FileMapInfo::map_heap_data(), call map_heap_data() and if it returns
false, free the array in a single place.
On 2/14/20 7:09 AM, Thomas Schatzl wrote:
> Hi all,
> can I have reviews for this change that plugs a (tiny) memory leak
> when we unsuccessfully map CDS archives into the Java heap?
> The FileMapInfo::map_heap_data() method allocates some array of
> MemRegions, and in case we fail to map the archive, we return that
> method without assigning it to something or deallocating that memory.
> Found while working on JDK-8238999, also out for review, and depending
> on it.
More information about the hotspot-gc-dev