src/hotspot/share/runtime/safepoint.cpp
changeset 51338 aa3bfacc912c
parent 51334 cc2c79d22508
child 51376 181e6a03249b
equal deleted inserted replaced
51337:0bcb90968b3c 51338:aa3bfacc912c
    21  * questions.
    21  * questions.
    22  *
    22  *
    23  */
    23  */
    24 
    24 
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "classfile/classLoaderData.hpp"
    26 #include "classfile/classLoaderData.inline.hpp"
    27 #include "classfile/stringTable.hpp"
    27 #include "classfile/stringTable.hpp"
    28 #include "classfile/symbolTable.hpp"
    28 #include "classfile/symbolTable.hpp"
    29 #include "classfile/systemDictionary.hpp"
    29 #include "classfile/systemDictionary.hpp"
    30 #include "code/codeCache.hpp"
    30 #include "code/codeCache.hpp"
    31 #include "code/icBuffer.hpp"
    31 #include "code/icBuffer.hpp"
   717       ClassLoaderDataGraph::resize_if_needed();
   717       ClassLoaderDataGraph::resize_if_needed();
   718       if (event.should_commit()) {
   718       if (event.should_commit()) {
   719         post_safepoint_cleanup_task_event(&event, name);
   719         post_safepoint_cleanup_task_event(&event, name);
   720       }
   720       }
   721     }
   721     }
       
   722 
   722     _subtasks.all_tasks_completed(_num_workers);
   723     _subtasks.all_tasks_completed(_num_workers);
   723   }
   724   }
   724 };
   725 };
   725 
   726 
   726 // Various cleaning tasks that should be done periodically at safepoints.
   727 // Various cleaning tasks that should be done periodically at safepoints.
   746     ParallelSPCleanupTask cleanup(1, &deflate_counters);
   747     ParallelSPCleanupTask cleanup(1, &deflate_counters);
   747     StrongRootsScope srs(1);
   748     StrongRootsScope srs(1);
   748     cleanup.work(0);
   749     cleanup.work(0);
   749   }
   750   }
   750 
   751 
       
   752   // Needs to be done single threaded by the VMThread.  This walks
       
   753   // the thread stacks looking for references to metadata before
       
   754   // deciding to remove it from the metaspaces.
       
   755   if (ClassLoaderDataGraph::should_clean_metaspaces_and_reset()) {
       
   756     const char* name = "cleanup live ClassLoaderData metaspaces";
       
   757     TraceTime timer(name, TRACETIME_LOG(Info, safepoint, cleanup));
       
   758     ClassLoaderDataGraph::walk_metadata_and_clean_metaspaces();
       
   759   }
       
   760 
   751   // Finish monitor deflation.
   761   // Finish monitor deflation.
   752   ObjectSynchronizer::finish_deflate_idle_monitors(&deflate_counters);
   762   ObjectSynchronizer::finish_deflate_idle_monitors(&deflate_counters);
       
   763 
   753 }
   764 }
   754 
   765 
   755 
   766 
   756 bool SafepointSynchronize::safepoint_safe(JavaThread *thread, JavaThreadState state) {
   767 bool SafepointSynchronize::safepoint_safe(JavaThread *thread, JavaThreadState state) {
   757   switch(state) {
   768   switch(state) {