src/hotspot/share/memory/metaspace/chunkManager.cpp
branchstuefe-new-metaspace-branch
changeset 58085 a5f523f2ff91
parent 58063 bdf136b8ae0e
child 58333 78b2e8f46dd4
equal deleted inserted replaced
58070:2cecbd566968 58085:a5f523f2ff91
   207     // Tracing
   207     // Tracing
   208     log_debug(metaspace)("ChunkManager %s: need new root chunk.", _name);
   208     log_debug(metaspace)("ChunkManager %s: need new root chunk.", _name);
   209 
   209 
   210     c = _vslist->allocate_root_chunk();
   210     c = _vslist->allocate_root_chunk();
   211 
   211 
   212     // This should always work. Note that getting the root chunk may not mean we committed memory.
   212     // This may have failed if the virtual space list is exhausted but it cannot be expanded
   213     assert(c != NULL, "Unexpected");
   213     // by a new node (class space).
       
   214     if (c == NULL) {
       
   215       return NULL;
       
   216     }
       
   217 
   214     assert(c->level() == chklvl::LOWEST_CHUNK_LEVEL, "Not a root chunk?");
   218     assert(c->level() == chklvl::LOWEST_CHUNK_LEVEL, "Not a root chunk?");
   215 
   219 
   216     // Split this root chunk to the desired chunk size.
   220     // Split this root chunk to the desired chunk size.
   217     if (pref_level > c->level()) {
   221     if (pref_level > c->level()) {
   218       c = split_chunk_and_add_splinters(c, pref_level);
   222       c = split_chunk_and_add_splinters(c, pref_level);