Mercurial > hg > graal-jvmci-8
comparison src/share/vm/services/memTracker.hpp @ 8810:06db4c0afbf3
8009298: NMT: Special version of class loading/unloading with runThese stresses out NMT
8009777: NMT: add new NMT dcmd to control auto shutdown option
Summary: Added diagnostic VM option and DCmd command to allow NMT stay alive under stress situation
Reviewed-by: dcubed, coleenp
author | zgu |
---|---|
date | Wed, 20 Mar 2013 09:42:48 -0400 |
parents | 4102b59539ce |
children | b5bae74160b7 |
comparison
equal
deleted
inserted
replaced
8803:a649f6511c04 | 8810:06db4c0afbf3 |
---|---|
82 static inline void record_virtual_memory_type(address base, MEMFLAGS flags, | 82 static inline void record_virtual_memory_type(address base, MEMFLAGS flags, |
83 Thread* thread = NULL) { } | 83 Thread* thread = NULL) { } |
84 static inline bool baseline() { return false; } | 84 static inline bool baseline() { return false; } |
85 static inline bool has_baseline() { return false; } | 85 static inline bool has_baseline() { return false; } |
86 | 86 |
87 static inline void set_autoShutdown(bool value) { } | |
87 static void shutdown(ShutdownReason reason) { } | 88 static void shutdown(ShutdownReason reason) { } |
88 static inline bool shutdown_in_progress() { } | 89 static inline bool shutdown_in_progress() { } |
89 static bool print_memory_usage(BaselineOutputer& out, size_t unit, | 90 static bool print_memory_usage(BaselineOutputer& out, size_t unit, |
90 bool summary_only = true) { } | 91 bool summary_only = true) { } |
91 static bool compare_memory_usage(BaselineOutputer& out, size_t unit, | 92 static bool compare_memory_usage(BaselineOutputer& out, size_t unit, |
236 } | 237 } |
237 | 238 |
238 // if native memory tracking tracks callsite | 239 // if native memory tracking tracks callsite |
239 static inline bool track_callsite() { return _tracking_level == NMT_detail; } | 240 static inline bool track_callsite() { return _tracking_level == NMT_detail; } |
240 | 241 |
242 // NMT automatically shuts itself down under extreme situation by default. | |
243 // When the value is set to false, NMT will try its best to stay alive, | |
244 // even it has to slow down VM. | |
245 static inline void set_autoShutdown(bool value) { | |
246 AutoShutdownNMT = value; | |
247 if (AutoShutdownNMT && _slowdown_calling_thread) { | |
248 _slowdown_calling_thread = false; | |
249 } | |
250 } | |
251 | |
241 // shutdown native memory tracking capability. Native memory tracking | 252 // shutdown native memory tracking capability. Native memory tracking |
242 // can be shutdown by VM when it encounters low memory scenarios. | 253 // can be shutdown by VM when it encounters low memory scenarios. |
243 // Memory tracker should gracefully shutdown itself, and preserve the | 254 // Memory tracker should gracefully shutdown itself, and preserve the |
244 // latest memory statistics for post morten diagnosis. | 255 // latest memory statistics for post morten diagnosis. |
245 static void shutdown(ShutdownReason reason); | 256 static void shutdown(ShutdownReason reason); |
505 // the generation that NMT is processing | 516 // the generation that NMT is processing |
506 static volatile unsigned long _processing_generation; | 517 static volatile unsigned long _processing_generation; |
507 // although NMT is still procesing current generation, but | 518 // although NMT is still procesing current generation, but |
508 // there is not more recorder to process, set idle state | 519 // there is not more recorder to process, set idle state |
509 static volatile bool _worker_thread_idle; | 520 static volatile bool _worker_thread_idle; |
521 | |
522 // if NMT should slow down calling thread to allow | |
523 // worker thread to catch up | |
524 static volatile bool _slowdown_calling_thread; | |
510 }; | 525 }; |
511 | 526 |
512 #endif // !INCLUDE_NMT | 527 #endif // !INCLUDE_NMT |
513 | 528 |
514 #endif // SHARE_VM_SERVICES_MEM_TRACKER_HPP | 529 #endif // SHARE_VM_SERVICES_MEM_TRACKER_HPP |