mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8037842: Failing to allocate MethodCounters and MDO causes a serious performance drop
Stop allocating compiler profiling metadata when metaspace is full. Reviewed-by: kvn, anoll
This commit is contained in:
parent
b301b207b3
commit
4c036f5730
5 changed files with 62 additions and 4 deletions
|
@ -553,6 +553,7 @@ ClassLoaderData* ClassLoaderDataGraph::_saved_unloading = NULL;
|
|||
ClassLoaderData* ClassLoaderDataGraph::_saved_head = NULL;
|
||||
|
||||
bool ClassLoaderDataGraph::_should_purge = false;
|
||||
bool ClassLoaderDataGraph::_metaspace_oom = false;
|
||||
|
||||
// Add a new class loader data node to the list. Assign the newly created
|
||||
// ClassLoaderData into the java/lang/ClassLoader object as a hidden field
|
||||
|
@ -804,12 +805,17 @@ void ClassLoaderDataGraph::purge() {
|
|||
ClassLoaderData* list = _unloading;
|
||||
_unloading = NULL;
|
||||
ClassLoaderData* next = list;
|
||||
bool classes_unloaded = false;
|
||||
while (next != NULL) {
|
||||
ClassLoaderData* purge_me = next;
|
||||
next = purge_me->next();
|
||||
delete purge_me;
|
||||
classes_unloaded = true;
|
||||
}
|
||||
if (classes_unloaded) {
|
||||
Metaspace::purge();
|
||||
set_metaspace_oom(false);
|
||||
}
|
||||
Metaspace::purge();
|
||||
}
|
||||
|
||||
void ClassLoaderDataGraph::post_class_unload_events(void) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue