< prev index next >

src/hotspot/share/memory/metaspace/chunkManager.cpp

Print this page
rev 54012 : imported patch autouncommit-metachunks

@@ -301,10 +301,14 @@
   const size_t region_word_len = larger_chunk->word_size();
   MetaWord* const region_end = region_start + region_word_len;
   VirtualSpaceNode* const vsn = larger_chunk->container();
   OccupancyMap* const ocmap = vsn->occupancy_map();
 
+  if (AutoUncommitMetaChunks) {
+    larger_chunk->commit();
+  }
+
   // Any larger non-humongous chunk size is a multiple of any smaller chunk size.
   // Since non-humongous chunks are aligned to their chunk size, the larger chunk should start
   // at an address suitable to place the smaller target chunk.
   assert_is_aligned(region_start, target_chunk_word_size);
 

@@ -466,10 +470,14 @@
 
     log_trace(gc, metaspace, alloc)("Free list allocate humongous chunk size " SIZE_FORMAT " for requested size " SIZE_FORMAT " waste " SIZE_FORMAT,
                                     chunk->word_size(), word_size, chunk->word_size() - word_size);
   }
 
+  if (AutoUncommitMetaChunks) {
+    chunk->commit();
+  }
+
   // Chunk has been removed from the chunk manager; update counters.
   account_for_removed_chunk(chunk);
   do_update_in_use_info_for_chunk(chunk, true);
   chunk->container()->inc_container_count();
   chunk->inc_use_count();

@@ -597,10 +605,14 @@
     vsn->verify(true);
     vsn->verify_free_chunks_are_ideally_merged();
   END_EVERY_NTH
 #endif
 
+  if (AutoUncommitMetaChunks) {
+    chunk->uncommit();
+  }
+
 }
 
 void ChunkManager::return_chunk_list(Metachunk* chunks) {
   if (chunks == NULL) {
     return;
< prev index next >