src/hotspot/share/memory/metaspace/chunkManager.cpp
branchstuefe-new-metaspace-branch
changeset 58085 a5f523f2ff91
parent 58063 bdf136b8ae0e
child 58333 78b2e8f46dd4
--- a/src/hotspot/share/memory/metaspace/chunkManager.cpp	Tue Sep 10 15:05:00 2019 +0200
+++ b/src/hotspot/share/memory/metaspace/chunkManager.cpp	Wed Sep 11 17:36:28 2019 +0200
@@ -209,8 +209,12 @@
 
     c = _vslist->allocate_root_chunk();
 
-    // This should always work. Note that getting the root chunk may not mean we committed memory.
-    assert(c != NULL, "Unexpected");
+    // This may have failed if the virtual space list is exhausted but it cannot be expanded
+    // by a new node (class space).
+    if (c == NULL) {
+      return NULL;
+    }
+
     assert(c->level() == chklvl::LOWEST_CHUNK_LEVEL, "Not a root chunk?");
 
     // Split this root chunk to the desired chunk size.