22 * |
22 * |
23 */ |
23 */ |
24 |
24 |
25 #ifndef SHARE_VM_SERVICES_MEM_TRACKER_HPP |
25 #ifndef SHARE_VM_SERVICES_MEM_TRACKER_HPP |
26 #define SHARE_VM_SERVICES_MEM_TRACKER_HPP |
26 #define SHARE_VM_SERVICES_MEM_TRACKER_HPP |
|
27 |
|
28 #include "utilities/macros.hpp" |
|
29 |
|
30 #if !INCLUDE_NMT |
|
31 |
|
32 #include "utilities/ostream.hpp" |
|
33 |
|
34 class BaselineOutputer : public StackObj { |
|
35 |
|
36 }; |
|
37 |
|
38 class BaselineTTYOutputer : public BaselineOutputer { |
|
39 public: |
|
40 BaselineTTYOutputer(outputStream* st) { } |
|
41 }; |
|
42 |
|
43 class MemTracker : AllStatic { |
|
44 public: |
|
45 enum ShutdownReason { |
|
46 NMT_shutdown_none, // no shutdown requested |
|
47 NMT_shutdown_user, // user requested shutdown |
|
48 NMT_normal, // normal shutdown, process exit |
|
49 NMT_out_of_memory, // shutdown due to out of memory |
|
50 NMT_initialization, // shutdown due to initialization failure |
|
51 NMT_use_malloc_only, // can not combine NMT with UseMallocOnly flag |
|
52 NMT_error_reporting, // shutdown by vmError::report_and_die() |
|
53 NMT_out_of_generation, // running out of generation queue |
|
54 NMT_sequence_overflow // overflow the sequence number |
|
55 }; |
|
56 |
|
57 |
|
58 public: |
|
59 static inline void init_tracking_options(const char* option_line) { } |
|
60 static inline bool is_on() { return false; } |
|
61 static const char* reason() { return "Native memory tracking is not implemented"; } |
|
62 static inline bool can_walk_stack() { return false; } |
|
63 |
|
64 static inline void bootstrap_single_thread() { } |
|
65 static inline void bootstrap_multi_thread() { } |
|
66 static inline void start() { } |
|
67 |
|
68 static inline void record_malloc(address addr, size_t size, MEMFLAGS flags, |
|
69 address pc = 0, Thread* thread = NULL) { } |
|
70 static inline void record_free(address addr, MEMFLAGS flags, Thread* thread = NULL) { } |
|
71 static inline void record_realloc(address old_addr, address new_addr, size_t size, |
|
72 MEMFLAGS flags, address pc = 0, Thread* thread = NULL) { } |
|
73 static inline void record_arena_size(address addr, size_t size) { } |
|
74 static inline void record_virtual_memory_reserve(address addr, size_t size, |
|
75 address pc = 0, Thread* thread = NULL) { } |
|
76 static inline void record_virtual_memory_commit(address addr, size_t size, |
|
77 address pc = 0, Thread* thread = NULL) { } |
|
78 static inline void record_virtual_memory_uncommit(address addr, size_t size, |
|
79 Thread* thread = NULL) { } |
|
80 static inline void record_virtual_memory_release(address addr, size_t size, |
|
81 Thread* thread = NULL) { } |
|
82 static inline void record_virtual_memory_type(address base, MEMFLAGS flags, |
|
83 Thread* thread = NULL) { } |
|
84 static inline bool baseline() { return false; } |
|
85 static inline bool has_baseline() { return false; } |
|
86 |
|
87 static void shutdown(ShutdownReason reason) { } |
|
88 static inline bool shutdown_in_progress() { } |
|
89 static bool print_memory_usage(BaselineOutputer& out, size_t unit, |
|
90 bool summary_only = true) { } |
|
91 static bool compare_memory_usage(BaselineOutputer& out, size_t unit, |
|
92 bool summary_only = true) { } |
|
93 |
|
94 static inline void sync() { } |
|
95 static inline void thread_exiting(JavaThread* thread) { } |
|
96 |
|
97 }; |
|
98 |
|
99 |
|
100 #else // !INCLUDE_NMT |
27 |
101 |
28 #include "memory/allocation.hpp" |
102 #include "memory/allocation.hpp" |
29 #include "runtime/globals.hpp" |
103 #include "runtime/globals.hpp" |
30 #include "runtime/mutex.hpp" |
104 #include "runtime/mutex.hpp" |
31 #include "runtime/os.hpp" |
105 #include "runtime/os.hpp" |