8202669: Intermittent crash in ClassLoadingService::compute_class_size()

Don't report classes that failed to load when reporting class unloading. Remove the classes first.

Reviewed-by: dholmes, lfoltan, ccheung
This commit is contained in:
Coleen Phillimore 2018-05-22 13:10:56 -04:00
parent 3b38d1b418
commit 37e51f4074
3 changed files with 77 additions and 4 deletions

View file

@ -573,9 +573,6 @@ 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);
LogTarget(Debug, class, loader, data) lt;
if (lt.is_enabled()) {
ResourceMark rm;
@ -589,6 +586,10 @@ void ClassLoaderData::unload() {
// if they are not already on the _klasses list.
unload_deallocate_list();
// Tell serviceability tools these classes are unloading
// after erroneous classes are released.
classes_do(InstanceKlass::notify_unload_class);
// Clean up global class iterator for compiler
static_klass_iterator.adjust_saved_class(this);
}