Mercurial > hg > graal-jvmci-8
comparison src/share/vm/services/memoryManager.hpp @ 3356:78542e2b5e35
7036199: Adding a notification to the implementation of GarbageCollectorMXBeans
Summary: Add a notification to the GarbageCollectorMXBeans
Reviewed-by: acorn, mchung
author | fparain |
---|---|
date | Thu, 12 May 2011 10:30:11 -0700 |
parents | f95d63e2154a |
children | bf864f701a4a |
comparison
equal
deleted
inserted
replaced
3355:f1cbbee6713b | 3356:78542e2b5e35 |
---|---|
164 elapsedTimer _gc_timer; // for measuring every GC duration | 164 elapsedTimer _gc_timer; // for measuring every GC duration |
165 GCStatInfo* _last_gc_stat; | 165 GCStatInfo* _last_gc_stat; |
166 Mutex* _last_gc_lock; | 166 Mutex* _last_gc_lock; |
167 GCStatInfo* _current_gc_stat; | 167 GCStatInfo* _current_gc_stat; |
168 int _num_gc_threads; | 168 int _num_gc_threads; |
169 volatile bool _notification_enabled; | |
169 public: | 170 public: |
170 GCMemoryManager(); | 171 GCMemoryManager(); |
171 ~GCMemoryManager(); | 172 ~GCMemoryManager(); |
172 | 173 |
173 void initialize_gc_stat_info(); | 174 void initialize_gc_stat_info(); |
179 void set_num_gc_threads(int count) { _num_gc_threads = count; } | 180 void set_num_gc_threads(int count) { _num_gc_threads = count; } |
180 | 181 |
181 void gc_begin(bool recordGCBeginTime, bool recordPreGCUsage, | 182 void gc_begin(bool recordGCBeginTime, bool recordPreGCUsage, |
182 bool recordAccumulatedGCTime); | 183 bool recordAccumulatedGCTime); |
183 void gc_end(bool recordPostGCUsage, bool recordAccumulatedGCTime, | 184 void gc_end(bool recordPostGCUsage, bool recordAccumulatedGCTime, |
184 bool recordGCEndTime, bool countCollection); | 185 bool recordGCEndTime, bool countCollection, GCCause::Cause cause); |
185 | 186 |
186 void reset_gc_stat() { _num_collections = 0; _accumulated_timer.reset(); } | 187 void reset_gc_stat() { _num_collections = 0; _accumulated_timer.reset(); } |
187 | 188 |
188 // Copy out _last_gc_stat to the given destination, returning | 189 // Copy out _last_gc_stat to the given destination, returning |
189 // the collection count. Zero signifies no gc has taken place. | 190 // the collection count. Zero signifies no gc has taken place. |
190 size_t get_last_gc_stat(GCStatInfo* dest); | 191 size_t get_last_gc_stat(GCStatInfo* dest); |
191 | 192 |
193 void set_notification_enabled(bool enabled) { _notification_enabled = enabled; } | |
194 bool is_notification_enabled() { return _notification_enabled; } | |
192 virtual MemoryManager::Name kind() = 0; | 195 virtual MemoryManager::Name kind() = 0; |
193 }; | 196 }; |
194 | 197 |
195 // These subclasses of GCMemoryManager are defined to include | 198 // These subclasses of GCMemoryManager are defined to include |
196 // GC-specific information. | 199 // GC-specific information. |