mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
8208677: Move inner metaspace cleaning out of class unloading
Move to safepoint cleanup actions to do if needed. Reviewed-by: eosterlund, hseigel
This commit is contained in:
parent
149026aa65
commit
a7b66f6f5e
10 changed files with 94 additions and 31 deletions
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "classfile/classLoaderData.hpp"
|
||||
#include "classfile/classLoaderData.inline.hpp"
|
||||
#include "classfile/stringTable.hpp"
|
||||
#include "classfile/symbolTable.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
|
@ -719,6 +719,7 @@ public:
|
|||
post_safepoint_cleanup_task_event(&event, name);
|
||||
}
|
||||
}
|
||||
|
||||
_subtasks.all_tasks_completed(_num_workers);
|
||||
}
|
||||
};
|
||||
|
@ -748,8 +749,18 @@ 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();
|
||||
}
|
||||
|
||||
// Finish monitor deflation.
|
||||
ObjectSynchronizer::finish_deflate_idle_monitors(&deflate_counters);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue