mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8011803: release_C_heap_structures is never called for anonymous classes
Call this function from the ClassLoaderData destructor instead of the system dictionary walk. Reviewed-by: stefank, mgerdin
This commit is contained in:
parent
d567edd809
commit
cd7d504d54
4 changed files with 35 additions and 15 deletions
|
@ -277,6 +277,9 @@ void ClassLoaderData::remove_class(Klass* scratch_class) {
|
|||
void ClassLoaderData::unload() {
|
||||
_unloading = true;
|
||||
|
||||
// Tell serviceability tools these classes are unloading
|
||||
classes_do(InstanceKlass::notify_unload_class);
|
||||
|
||||
if (TraceClassLoaderData) {
|
||||
ResourceMark rm;
|
||||
tty->print("[ClassLoaderData: unload loader data "PTR_FORMAT, this);
|
||||
|
@ -300,6 +303,9 @@ bool ClassLoaderData::is_alive(BoolObjectClosure* is_alive_closure) const {
|
|||
|
||||
|
||||
ClassLoaderData::~ClassLoaderData() {
|
||||
// Release C heap structures for all the classes.
|
||||
classes_do(InstanceKlass::release_C_heap_structures);
|
||||
|
||||
Metaspace *m = _metaspace;
|
||||
if (m != NULL) {
|
||||
_metaspace = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue