8210559: ClassLoaderData Symbols can leak

Unrefcount the symbol names when the CLD is destroyed

Reviewed-by: lfoltan, jiangli, iklam
This commit is contained in:
Coleen Phillimore 2018-09-14 12:10:28 -04:00
parent b16e5584ab
commit bad4a92e55
5 changed files with 31 additions and 4 deletions

View file

@ -769,6 +769,14 @@ ClassLoaderData::~ClassLoaderData() {
if (_deallocate_list != NULL) {
delete _deallocate_list;
}
// Decrement refcounts of Symbols if created.
if (_name != NULL) {
_name->decrement_refcount();
}
if (_name_and_id != NULL) {
_name_and_id->decrement_refcount();
}
}
// Returns true if this class loader data is for the app class loader