1394 while (data != NULL) {
1395 // Remove entries in the dictionary of live class loader that have
1396 // initiated loading classes in a dead class loader.
1397 if (data->dictionary() != NULL) {
1398 data->dictionary()->do_unloading();
1399 }
1400 // Walk a ModuleEntry's reads, and a PackageEntry's exports
1401 // lists to determine if there are modules on those lists that are now
1402 // dead and should be removed. A module's life cycle is equivalent
1403 // to its defining class loader's life cycle. Since a module is
1404 // considered dead if its class loader is dead, these walks must
1405 // occur after each class loader's aliveness is determined.
1406 if (data->packages() != NULL) {
1407 data->packages()->purge_all_package_exports();
1408 }
1409 if (data->modules_defined()) {
1410 data->modules()->purge_all_module_reads();
1411 }
1412 data = data->next();
1413 }
1414 JFR_ONLY(post_class_unload_events();)
1415 }
1416
1417 log_debug(class, loader, data)("do_unloading: loaders processed %u, loaders removed %u", loaders_processed, loaders_removed);
1418
1419 return seen_dead_loader;
1420 }
1421
1422 void ClassLoaderDataGraph::purge() {
1423 assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!");
1424 ClassLoaderData* list = _unloading;
1425 _unloading = NULL;
1426 ClassLoaderData* next = list;
1427 bool classes_unloaded = false;
1428 while (next != NULL) {
1429 ClassLoaderData* purge_me = next;
1430 next = purge_me->next();
1431 delete purge_me;
1432 classes_unloaded = true;
1433 }
|
1394 while (data != NULL) {
1395 // Remove entries in the dictionary of live class loader that have
1396 // initiated loading classes in a dead class loader.
1397 if (data->dictionary() != NULL) {
1398 data->dictionary()->do_unloading();
1399 }
1400 // Walk a ModuleEntry's reads, and a PackageEntry's exports
1401 // lists to determine if there are modules on those lists that are now
1402 // dead and should be removed. A module's life cycle is equivalent
1403 // to its defining class loader's life cycle. Since a module is
1404 // considered dead if its class loader is dead, these walks must
1405 // occur after each class loader's aliveness is determined.
1406 if (data->packages() != NULL) {
1407 data->packages()->purge_all_package_exports();
1408 }
1409 if (data->modules_defined()) {
1410 data->modules()->purge_all_module_reads();
1411 }
1412 data = data->next();
1413 }
1414 SymbolTable::do_check_concurrent_work();
1415 JFR_ONLY(post_class_unload_events();)
1416 }
1417
1418 log_debug(class, loader, data)("do_unloading: loaders processed %u, loaders removed %u", loaders_processed, loaders_removed);
1419
1420 return seen_dead_loader;
1421 }
1422
1423 void ClassLoaderDataGraph::purge() {
1424 assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!");
1425 ClassLoaderData* list = _unloading;
1426 _unloading = NULL;
1427 ClassLoaderData* next = list;
1428 bool classes_unloaded = false;
1429 while (next != NULL) {
1430 ClassLoaderData* purge_me = next;
1431 next = purge_me->next();
1432 delete purge_me;
1433 classes_unloaded = true;
1434 }
|