RFR 8201265: Native memory leak in ClassLoader::add_to_exploded_build_list

Lois Foltan lois.foltan at oracle.com
Mon Apr 9 21:16:22 UTC 2018

On 4/9/2018 4:35 PM, harold seigel wrote:

> Hi,
> Please review this small fix for JDK-8201265.  The fix deletes the 
> native memory before propagating back the exception.
> Open Webrev: 
> http://cr.openjdk.java.net/~hseigel/bug_8201265/webrev/index.html
Hi Harold,

I think the use of NEW_C_HEAP_ARRAY at line #874 is incorrect within 
ClassLoader::add_to_exploded_build_list().  If you look at both lines 
#754 & 818, NEW_RESOURCE_ARRAY is used prior to the call to 
create_class_path_entry().  I believe all the 
ClassLoader::create_class_path_entry() constructors for file, dir, zip, 
etc. allocate their own C_HEAP_ARRAY and make a copy of the "path" 

So I think the correct fix is to change #874 to use NEW_RESOURCE_ARRAY 
and remove the lines you added to check for pending exception.  And 
remove the FREE_C_HEAP_ARRAY at line #900.


> JBS Bug:  https://bugs.openjdk.java.net/browse/JDK-8201265
> This fix was tested with Mach5 tiers 1 and 2 tests and builds on all 
> Mach5 platforms and with tiers 3-5 tests on Linux-x64.
> Thanks, Harold

More information about the hotspot-runtime-dev mailing list