src/hotspot/share/classfile/classLoaderData.cpp
changeset 50219 4ab066d71956
parent 50113 caf115bb98ad
child 50599 ecc2af326b5f
--- a/src/hotspot/share/classfile/classLoaderData.cpp	Tue May 22 09:01:44 2018 -0700
+++ b/src/hotspot/share/classfile/classLoaderData.cpp	Tue May 22 13:10:56 2018 -0400
@@ -573,9 +573,6 @@
 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 @@
   // 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);
 }