8252043: Move inner class metaspace cleaning out of safepoint cleanup tasks

Clean up inner metaspaces from ServiceThread if cleanup is needed for concurrent GCs.

Reviewed-by: eosterlund, pchilanomate
This commit is contained in:
Coleen Phillimore 2020-08-21 10:01:40 -04:00
parent 9d00332ee5
commit fac22ce20c
14 changed files with 60 additions and 28 deletions

View file

@ -23,7 +23,7 @@
*/
#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.inline.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/dictionary.hpp"
#include "classfile/stringTable.hpp"
#include "classfile/symbolTable.hpp"
@ -599,15 +599,6 @@ void SafepointSynchronize::do_cleanup_tasks() {
cleanup.work(0);
}
// Needs to be done single threaded by the VMThread. This walks
// the thread stacks looking for references to metadata before
// deciding to remove it from the metaspaces.
if (ClassLoaderDataGraph::should_clean_metaspaces_and_reset()) {
const char* name = "cleanup live ClassLoaderData metaspaces";
TraceTime timer(name, TRACETIME_LOG(Info, safepoint, cleanup));
ClassLoaderDataGraph::walk_metadata_and_clean_metaspaces();
}
assert(InlineCacheBuffer::is_empty(), "should have cleaned up ICBuffer");
}