< prev index next >

src/hotspot/share/services/memTracker.cpp

Print this page

        

@@ -30,10 +30,11 @@
 #include "runtime/vm_operations.hpp"
 #include "services/memBaseline.hpp"
 #include "services/memReporter.hpp"
 #include "services/mallocTracker.inline.hpp"
 #include "services/memTracker.hpp"
+#include "utilities/debug.hpp"
 #include "utilities/defaultStream.hpp"
 #include "utilities/vmError.hpp"
 
 #ifdef SOLARIS
   volatile bool NMT_stack_walkable = false;

@@ -48,10 +49,13 @@
 Mutex*      MemTracker::_query_lock = NULL;
 bool MemTracker::_is_nmt_env_valid = true;
 
 
 NMT_TrackingLevel MemTracker::init_tracking_level() {
+  // memory type occupies a byte
+  STATIC_ASSERT(mt_number_of_types <= max_jubyte);
+
   NMT_TrackingLevel level = NMT_off;
   char buf[64];
   jio_snprintf(buf, sizeof(buf), "NMT_LEVEL_%d", os::current_process_id());
   const char *nmt_option = ::getenv(buf);
   if (nmt_option != NULL) {
< prev index next >