equal
deleted
inserted
replaced
30 #include "runtime/vm_operations.hpp" |
30 #include "runtime/vm_operations.hpp" |
31 #include "services/memBaseline.hpp" |
31 #include "services/memBaseline.hpp" |
32 #include "services/memReporter.hpp" |
32 #include "services/memReporter.hpp" |
33 #include "services/mallocTracker.inline.hpp" |
33 #include "services/mallocTracker.inline.hpp" |
34 #include "services/memTracker.hpp" |
34 #include "services/memTracker.hpp" |
|
35 #include "utilities/debug.hpp" |
35 #include "utilities/defaultStream.hpp" |
36 #include "utilities/defaultStream.hpp" |
36 #include "utilities/vmError.hpp" |
37 #include "utilities/vmError.hpp" |
37 |
38 |
38 #ifdef SOLARIS |
39 #ifdef SOLARIS |
39 volatile bool NMT_stack_walkable = false; |
40 volatile bool NMT_stack_walkable = false; |
48 Mutex* MemTracker::_query_lock = NULL; |
49 Mutex* MemTracker::_query_lock = NULL; |
49 bool MemTracker::_is_nmt_env_valid = true; |
50 bool MemTracker::_is_nmt_env_valid = true; |
50 |
51 |
51 |
52 |
52 NMT_TrackingLevel MemTracker::init_tracking_level() { |
53 NMT_TrackingLevel MemTracker::init_tracking_level() { |
|
54 // Memory type is encoded into tracking header as a byte field, |
|
55 // make sure that we don't overflow it. |
|
56 STATIC_ASSERT(mt_number_of_types <= max_jubyte); |
|
57 |
53 NMT_TrackingLevel level = NMT_off; |
58 NMT_TrackingLevel level = NMT_off; |
54 char buf[64]; |
59 char buf[64]; |
55 jio_snprintf(buf, sizeof(buf), "NMT_LEVEL_%d", os::current_process_id()); |
60 jio_snprintf(buf, sizeof(buf), "NMT_LEVEL_%d", os::current_process_id()); |
56 const char *nmt_option = ::getenv(buf); |
61 const char *nmt_option = ::getenv(buf); |
57 if (nmt_option != NULL) { |
62 if (nmt_option != NULL) { |