src/hotspot/share/services/memReporter.cpp
changeset 53685 df83034c9275
parent 49980 57dd7b4ba338
child 53709 2b64ebacce93
--- a/src/hotspot/share/services/memReporter.cpp	Thu Feb 07 12:09:17 2019 +0000
+++ b/src/hotspot/share/services/memReporter.cpp	Thu Feb 07 14:29:17 2019 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -240,7 +240,7 @@
     const NativeCallStack* stack = malloc_site->call_stack();
     stack->print_on(out);
     out->print("%29s", " ");
-    MEMFLAGS flag = malloc_site->flags();
+    MEMFLAGS flag = malloc_site->flag();
     assert((flag >= 0 && flag < (int)mt_number_of_types) && flag != mtNone,
       "Must have a valid memory type");
     print_malloc(malloc_site->size(), malloc_site->count(),flag);
@@ -266,6 +266,10 @@
     stack->print_on(out);
     out->print("%28s (", " ");
     print_total(virtual_memory_site->reserved(), virtual_memory_site->committed());
+    MEMFLAGS flag = virtual_memory_site->flag();
+    if (flag != mtNone) {
+      out->print(" Type=%s", NMTUtil::flag_to_name(flag));
+    }
     out->print_cr(")\n");
   }
 }
@@ -690,19 +694,19 @@
 
 void MemDetailDiffReporter::new_malloc_site(const MallocSite* malloc_site) const {
   diff_malloc_site(malloc_site->call_stack(), malloc_site->size(), malloc_site->count(),
-    0, 0, malloc_site->flags());
+    0, 0, malloc_site->flag());
 }
 
 void MemDetailDiffReporter::old_malloc_site(const MallocSite* malloc_site) const {
   diff_malloc_site(malloc_site->call_stack(), 0, 0, malloc_site->size(),
-    malloc_site->count(), malloc_site->flags());
+    malloc_site->count(), malloc_site->flag());
 }
 
 void MemDetailDiffReporter::diff_malloc_site(const MallocSite* early,
   const MallocSite* current)  const {
-  assert(early->flags() == current->flags(), "Must be the same memory type");
+  assert(early->flag() == current->flag(), "Must be the same memory type");
   diff_malloc_site(current->call_stack(), current->size(), current->count(),
-    early->size(), early->count(), early->flags());
+    early->size(), early->count(), early->flag());
 }
 
 void MemDetailDiffReporter::diff_malloc_site(const NativeCallStack* stack, size_t current_size,
@@ -725,21 +729,22 @@
 
 
 void MemDetailDiffReporter::new_virtual_memory_site(const VirtualMemoryAllocationSite* site) const {
-  diff_virtual_memory_site(site->call_stack(), site->reserved(), site->committed(), 0, 0);
+  diff_virtual_memory_site(site->call_stack(), site->reserved(), site->committed(), 0, 0, site->flag());
 }
 
 void MemDetailDiffReporter::old_virtual_memory_site(const VirtualMemoryAllocationSite* site) const {
-  diff_virtual_memory_site(site->call_stack(), 0, 0, site->reserved(), site->committed());
+  diff_virtual_memory_site(site->call_stack(), 0, 0, site->reserved(), site->committed(), site->flag());
 }
 
 void MemDetailDiffReporter::diff_virtual_memory_site(const VirtualMemoryAllocationSite* early,
   const VirtualMemoryAllocationSite* current) const {
+  assert(early->flag() == current->flag(), "Should be the same");
   diff_virtual_memory_site(current->call_stack(), current->reserved(), current->committed(),
-    early->reserved(), early->committed());
+    early->reserved(), early->committed(), current->flag());
 }
 
 void MemDetailDiffReporter::diff_virtual_memory_site(const NativeCallStack* stack, size_t current_reserved,
-  size_t current_committed, size_t early_reserved, size_t early_committed) const  {
+  size_t current_committed, size_t early_reserved, size_t early_committed, MEMFLAGS flag) const  {
   outputStream* out = output();
 
   // no change
@@ -753,5 +758,9 @@
   print_virtual_memory_diff(current_reserved, current_committed,
     early_reserved, early_committed);
 
+  if (flag != mtNone) {
+    out->print(" Type=%s", NMTUtil::flag_to_name(flag));
+  }
+
   out->print_cr(")\n");
  }