< prev index next >

src/hotspot/share/memory/metaspace.cpp

Print this page
rev 50023 : [mq]: 8185034-cleanup-and-consolidate-metaspace-coding

@@ -243,11 +243,10 @@
   void slow_locked_verify_free_chunks_count() {
     if (VerifyMetaspace) {
       locked_verify_free_chunks_count();
     }
   }
-  void verify_free_chunks_count();
 
   // Given a pointer to a chunk, attempts to merge it with neighboring
   // free chunks to form a bigger chunk. Returns true if successful.
   bool attempt_to_coalesce_around_chunk(Metachunk* chunk, ChunkIndex target_chunk_type);
 

@@ -366,17 +365,14 @@
   void slow_locked_verify() {
     if (VerifyMetaspace) {
       locked_verify();
     }
   }
-  void verify_free_chunks_total();
 
   void locked_print_free_chunks(outputStream* st);
   void locked_print_sum_free_chunks(outputStream* st);
 
-  void print_on(outputStream* st) const;
-
   // Fill in current statistic values to the given statistics object.
   void collect_statistics(ChunkManagerStatistics* out) const;
 
 };
 

@@ -1703,11 +1699,10 @@
     if (lt.is_enabled()) {
       LogStream ls(lt);
       ls.print("VirtualSpaceNode::take_from_committed() not available " SIZE_FORMAT " words ", chunk_word_size);
       // Dump some information about the virtual space that is nearly full
       print_on(&ls);
-      ls.cr(); // ~LogStream does not autoflush.
     }
     return NULL;
   }
 
   // Take the space  (bump top on the current virtual space).

@@ -2219,11 +2214,10 @@
   if (lt.is_enabled()) {
     LogStream ls(lt);
     VirtualSpaceNode* vsl = current_virtual_space();
     ResourceMark rm;
     vsl->print_on(&ls);
-    ls.cr(); // ~LogStream does not autoflush.
   }
 }
 
 bool VirtualSpaceList::expand_node_by(VirtualSpaceNode* node,
                                       size_t min_words,

@@ -2708,32 +2702,18 @@
          "_free_chunks_total " SIZE_FORMAT " is not the"
          " same as sum " SIZE_FORMAT, _free_chunks_total,
          sum_free_chunks());
 }
 
-void ChunkManager::verify_free_chunks_total() {
-  MutexLockerEx cl(MetaspaceExpand_lock,
-                     Mutex::_no_safepoint_check_flag);
-  locked_verify_free_chunks_total();
-}
-
 void ChunkManager::locked_verify_free_chunks_count() {
   assert_lock_strong(MetaspaceExpand_lock);
   assert(sum_free_chunks_count() == _free_chunks_count,
          "_free_chunks_count " SIZE_FORMAT " is not the"
          " same as sum " SIZE_FORMAT, _free_chunks_count,
          sum_free_chunks_count());
 }
 
-void ChunkManager::verify_free_chunks_count() {
-#ifdef ASSERT
-  MutexLockerEx cl(MetaspaceExpand_lock,
-                     Mutex::_no_safepoint_check_flag);
-  locked_verify_free_chunks_count();
-#endif
-}
-
 void ChunkManager::verify() {
   MutexLockerEx cl(MetaspaceExpand_lock,
                      Mutex::_no_safepoint_check_flag);
   locked_verify();
 }

@@ -3039,11 +3019,10 @@
     LogStream ls(lt);
     ls.print("ChunkManager::chunk_freelist_allocate: " PTR_FORMAT " chunk " PTR_FORMAT "  size " SIZE_FORMAT " count " SIZE_FORMAT " ",
              p2i(this), p2i(chunk), chunk->word_size(), list_count);
     ResourceMark rm;
     locked_print_free_chunks(&ls);
-    ls.cr(); // ~LogStream does not autoflush.
   }
 
   return chunk;
 }
 

@@ -3130,14 +3109,10 @@
       log.print("updated dictionary count " SIZE_FORMAT ".", _humongous_dictionary.total_count());
     }
   }
 }
 
-void ChunkManager::print_on(outputStream* out) const {
-  _humongous_dictionary.report_statistics(out);
-}
-
 void ChunkManager::collect_statistics(ChunkManagerStatistics* out) const {
   MutexLockerEx cl(MetaspaceExpand_lock, Mutex::_no_safepoint_check_flag);
   for (ChunkIndex i = ZeroIndex; i < NumberOfInUseLists; i = next_chunk_index(i)) {
     out->chunk_stats(i).add(num_free_chunks(i), size_free_chunks_in_bytes(i) / sizeof(MetaWord));
   }

@@ -3218,11 +3193,10 @@
       st->cr();
     }
   }
 
   chunk_manager()->locked_print_free_chunks(st);
-  chunk_manager()->locked_print_sum_free_chunks(st);
 }
 
 size_t SpaceManager::calc_chunk_size(size_t word_size) {
 
   // Decide between a small chunk and a medium chunk.  Up to

@@ -3416,11 +3390,10 @@
     LogStream ls(log.trace());
     locked_print_chunks_in_use_on(&ls);
     if (block_freelists() != NULL) {
       block_freelists()->print_on(&ls);
     }
-    ls.cr(); // ~LogStream does not autoflush.
   }
 
   // Add all the chunks in use by this space manager
   // to the global list of free chunks.
 

@@ -3485,11 +3458,10 @@
     log.trace("SpaceManager::added chunk: ");
     ResourceMark rm;
     LogStream ls(log.trace());
     new_chunk->print_on(&ls);
     chunk_manager()->locked_print_free_chunks(&ls);
-    ls.cr(); // ~LogStream does not autoflush.
   }
 }
 
 void SpaceManager::retire_current_chunk() {
   if (current_chunk() != NULL) {

@@ -4439,11 +4411,10 @@
   LogTarget(Trace, gc, metaspace) lt;
   if (lt.is_enabled()) {
     ResourceMark rm;
     LogStream ls(lt);
     print_compressed_class_space(&ls, requested_addr);
-    ls.cr(); // ~LogStream does not autoflush.
   }
 }
 
 void Metaspace::print_compressed_class_space(outputStream* st, const char* requested_addr) {
   st->print_cr("Narrow klass base: " PTR_FORMAT ", Narrow klass shift: %d",

@@ -4661,17 +4632,15 @@
     ResourceMark rm;
     if (log.is_debug()) {
       if (loader_data->metaspace_or_null() != NULL) {
         LogStream ls(log.debug());
         loader_data->print_value_on(&ls);
-        ls.cr(); // ~LogStream does not autoflush.
       }
     }
     LogStream ls(log.info());
     // In case of an OOM, log out a short but still useful report.
     MetaspaceUtils::print_basic_report(&ls, 0);
-    ls.cr(); // ~LogStream does not autoflush.
   }
 
   bool out_of_compressed_class_space = false;
   if (is_class_space_allocation(mdtype)) {
     ClassLoaderMetaspace* metaspace = loader_data->metaspace_non_null();
< prev index next >