changeset 5176:ad77e76008f3

8020530: Non heap memory size calculated incorrectly Reviewed-by: coleenp, sla
author vkempik
date Thu, 30 Jan 2014 19:53:46 +0400
parents 81194fd56a9d
children 8820d6ecaa4e
files src/share/vm/services/management.cpp
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/services/management.cpp	Thu Dec 19 09:22:30 2013 +0100
+++ b/src/share/vm/services/management.cpp	Thu Jan 30 19:53:46 2014 +0400
@@ -851,8 +851,6 @@
       total_used += u.used();
       total_committed += u.committed();
 
-      // if any one of the memory pool has undefined init_size or max_size,
-      // set it to -1
       if (u.init_size() == (size_t)-1) {
         has_undefined_init_size = true;
       }
@@ -869,6 +867,15 @@
     }
   }
 
+  // if any one of the memory pool has undefined init_size or max_size,
+  // set it to -1
+  if (has_undefined_init_size) {
+    total_init = (size_t)-1;
+  }
+  if (has_undefined_max_size) {
+    total_max = (size_t)-1;
+  }
+
   // In our current implementation, we make sure that all non-heap
   // pools have defined init and max sizes. Heap pools do not matter,
   // as we never use total_init and total_max for them.