diff src/share/vm/services/mallocTracker.hpp @ 20366:dd3939fe8424

8054546: NMT2 leaks memory Summary: Fixed memory leak in NMT by baselining memory in c heap instead of an arena. Reviewed-by: coleenp, minqi
author zgu
date Wed, 20 Aug 2014 08:41:15 -0400
parents 833b0f92429a
children 417e3b8d04c5
line wrap: on
line diff
--- a/src/share/vm/services/mallocTracker.hpp	Tue Aug 19 09:05:55 2014 -0400
+++ b/src/share/vm/services/mallocTracker.hpp	Wed Aug 20 08:41:15 2014 -0400
@@ -171,8 +171,9 @@
   // Total malloc'd memory used by arenas
   size_t total_arena() const;
 
-  inline size_t thread_count() {
-    return by_type(mtThreadStack)->malloc_count();
+  inline size_t thread_count() const {
+    MallocMemorySnapshot* s = const_cast<MallocMemorySnapshot*>(this);
+    return s->by_type(mtThreadStack)->malloc_count();
   }
 
   void reset();