--- old/src/hotspot/share/oops/instanceKlass.cpp 2020-04-24 14:19:35.541033657 -0400 +++ new/src/hotspot/share/oops/instanceKlass.cpp 2020-04-24 14:19:35.169023986 -0400 @@ -587,9 +587,9 @@ // to deallocate. assert(array_klasses() == NULL, "array classes shouldn't be created for this class yet"); - // Release C heap allocated data that this might point to, which includes + // Release C heap allocated data that this points to, which includes // reference counting symbol names. - release_C_heap_structures(); + release_C_heap_structures_internal(); deallocate_methods(loader_data, methods()); set_methods(NULL); @@ -2386,7 +2386,6 @@ it->push((Klass**)&_array_klasses); it->push(&_constants); it->push(&_inner_classes); - it->push(&_array_name); #if INCLUDE_JVMTI it->push(&_previous_versions); #endif @@ -2581,17 +2580,19 @@ m->release_C_heap_structures(); } -void InstanceKlass::release_C_heap_structures(InstanceKlass* ik) { +void InstanceKlass::release_C_heap_structures() { + // Clean up C heap - ik->release_C_heap_structures(); - ik->constants()->release_C_heap_structures(); + release_C_heap_structures_internal(); + constants()->release_C_heap_structures(); // Deallocate and call destructors for MDO mutexes - ik->methods_do(method_release_C_heap_structures); - + methods_do(method_release_C_heap_structures); } -void InstanceKlass::release_C_heap_structures() { +void InstanceKlass::release_C_heap_structures_internal() { + Klass::release_C_heap_structures(); + // Can't release the constant pool here because the constant pool can be // deallocated separately from the InstanceKlass for default methods and // redefine classes. @@ -2629,12 +2630,6 @@ } #endif - // Decrement symbol reference counts associated with the unloaded class. - if (_name != NULL) _name->decrement_refcount(); - - // unreference array name derived from this class name (arrays of an unloaded - // class can't be referenced anymore). - if (_array_name != NULL) _array_name->decrement_refcount(); FREE_C_HEAP_ARRAY(char, _source_debug_extension); }