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