8185262: Keep default logging for Metaspace OOM short and concise
authorstuefe
Wed, 26 Jul 2017 11:47:11 +0200
changeset 46723 5c418c5fcade
parent 46722 ae2cfffe2e64
child 46724 a4653c2a4e65
8185262: Keep default logging for Metaspace OOM short and concise Reviewed-by: iklam, coleenp
hotspot/src/share/vm/memory/metaspace.cpp
--- a/hotspot/src/share/vm/memory/metaspace.cpp	Wed Jul 26 10:41:07 2017 -0400
+++ b/hotspot/src/share/vm/memory/metaspace.cpp	Wed Jul 26 11:47:11 2017 +0200
@@ -3735,10 +3735,13 @@
     log.info("Metaspace (%s) allocation failed for size " SIZE_FORMAT,
              is_class_space_allocation(mdtype) ? "class" : "data", word_size);
     ResourceMark rm;
+    if (log.is_debug()) {
+      if (loader_data->metaspace_or_null() != NULL) {
+        LogStream ls(log.debug());
+        loader_data->dump(&ls);
+      }
+    }
     LogStream ls(log.info());
-    if (loader_data->metaspace_or_null() != NULL) {
-      loader_data->dump(&ls);
-    }
     MetaspaceAux::dump(&ls);
     ChunkManager::print_all_chunkmanagers(&ls);
   }