Mercurial > hg > graal-jvmci-8
diff 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 |
line wrap: on
line diff
--- a/src/share/vm/services/memTracker.hpp Wed Mar 20 08:17:55 2013 +0100 +++ b/src/share/vm/services/memTracker.hpp Wed Mar 20 09:42:48 2013 -0400 @@ -84,6 +84,7 @@ static inline bool baseline() { return false; } static inline bool has_baseline() { return false; } + static inline void set_autoShutdown(bool value) { } static void shutdown(ShutdownReason reason) { } static inline bool shutdown_in_progress() { } static bool print_memory_usage(BaselineOutputer& out, size_t unit, @@ -238,6 +239,16 @@ // if native memory tracking tracks callsite static inline bool track_callsite() { return _tracking_level == NMT_detail; } + // NMT automatically shuts itself down under extreme situation by default. + // When the value is set to false, NMT will try its best to stay alive, + // even it has to slow down VM. + static inline void set_autoShutdown(bool value) { + AutoShutdownNMT = value; + if (AutoShutdownNMT && _slowdown_calling_thread) { + _slowdown_calling_thread = false; + } + } + // shutdown native memory tracking capability. Native memory tracking // can be shutdown by VM when it encounters low memory scenarios. // Memory tracker should gracefully shutdown itself, and preserve the @@ -507,6 +518,10 @@ // although NMT is still procesing current generation, but // there is not more recorder to process, set idle state static volatile bool _worker_thread_idle; + + // if NMT should slow down calling thread to allow + // worker thread to catch up + static volatile bool _slowdown_calling_thread; }; #endif // !INCLUDE_NMT