--- old/src/share/vm/services/mallocTracker.hpp 2014-08-12 07:52:22.079968000 -0700 +++ new/src/share/vm/services/mallocTracker.hpp 2014-08-12 07:52:21.028065000 -0700 @@ -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(this); + return s->by_type(mtThreadStack)->malloc_count(); } void reset();