Mercurial > hg > graal-jvmci-8
comparison src/share/vm/services/memoryService.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 | da91efe96a93 |
comparison
equal
deleted
inserted
replaced
3355:f1cbbee6713b | 3356:78542e2b5e35 |
---|---|
27 | 27 |
28 #include "memory/allocation.hpp" | 28 #include "memory/allocation.hpp" |
29 #include "memory/generation.hpp" | 29 #include "memory/generation.hpp" |
30 #include "runtime/handles.hpp" | 30 #include "runtime/handles.hpp" |
31 #include "services/memoryUsage.hpp" | 31 #include "services/memoryUsage.hpp" |
32 #include "gc_interface/gcCause.hpp" | |
32 | 33 |
33 // Forward declaration | 34 // Forward declaration |
34 class MemoryPool; | 35 class MemoryPool; |
35 class MemoryManager; | 36 class MemoryManager; |
36 class GCMemoryManager; | 37 class GCMemoryManager; |
160 static void gc_begin(bool fullGC, bool recordGCBeginTime, | 161 static void gc_begin(bool fullGC, bool recordGCBeginTime, |
161 bool recordAccumulatedGCTime, | 162 bool recordAccumulatedGCTime, |
162 bool recordPreGCUsage, bool recordPeakUsage); | 163 bool recordPreGCUsage, bool recordPeakUsage); |
163 static void gc_end(bool fullGC, bool recordPostGCUsage, | 164 static void gc_end(bool fullGC, bool recordPostGCUsage, |
164 bool recordAccumulatedGCTime, | 165 bool recordAccumulatedGCTime, |
165 bool recordGCEndTime, bool countCollection); | 166 bool recordGCEndTime, bool countCollection, |
167 GCCause::Cause cause); | |
166 | 168 |
167 | 169 |
168 static void oops_do(OopClosure* f); | 170 static void oops_do(OopClosure* f); |
169 | 171 |
170 static bool get_verbose() { return PrintGC; } | 172 static bool get_verbose() { return PrintGC; } |
171 static bool set_verbose(bool verbose); | 173 static bool set_verbose(bool verbose); |
172 | 174 |
173 // Create an instance of java/lang/management/MemoryUsage | 175 // Create an instance of java/lang/management/MemoryUsage |
174 static Handle create_MemoryUsage_obj(MemoryUsage usage, TRAPS); | 176 static Handle create_MemoryUsage_obj(MemoryUsage usage, TRAPS); |
177 | |
178 static const GCMemoryManager* get_minor_gc_manager() { | |
179 return _minor_gc_manager; | |
180 } | |
181 | |
182 static const GCMemoryManager* get_major_gc_manager() { | |
183 return _major_gc_manager; | |
184 } | |
175 }; | 185 }; |
176 | 186 |
177 class TraceMemoryManagerStats : public StackObj { | 187 class TraceMemoryManagerStats : public StackObj { |
178 private: | 188 private: |
179 bool _fullGC; | 189 bool _fullGC; |
182 bool _recordPeakUsage; | 192 bool _recordPeakUsage; |
183 bool _recordPostGCUsage; | 193 bool _recordPostGCUsage; |
184 bool _recordAccumulatedGCTime; | 194 bool _recordAccumulatedGCTime; |
185 bool _recordGCEndTime; | 195 bool _recordGCEndTime; |
186 bool _countCollection; | 196 bool _countCollection; |
187 | 197 GCCause::Cause _cause; |
188 public: | 198 public: |
189 TraceMemoryManagerStats() {} | 199 TraceMemoryManagerStats() {} |
190 TraceMemoryManagerStats(bool fullGC, | 200 TraceMemoryManagerStats(bool fullGC, |
201 GCCause::Cause cause, | |
191 bool recordGCBeginTime = true, | 202 bool recordGCBeginTime = true, |
192 bool recordPreGCUsage = true, | 203 bool recordPreGCUsage = true, |
193 bool recordPeakUsage = true, | 204 bool recordPeakUsage = true, |
194 bool recordPostGCUsage = true, | 205 bool recordPostGCUsage = true, |
195 bool recordAccumulatedGCTime = true, | 206 bool recordAccumulatedGCTime = true, |
196 bool recordGCEndTime = true, | 207 bool recordGCEndTime = true, |
197 bool countCollection = true); | 208 bool countCollection = true); |
198 | 209 |
199 void initialize(bool fullGC, | 210 void initialize(bool fullGC, |
211 GCCause::Cause cause, | |
200 bool recordGCBeginTime, | 212 bool recordGCBeginTime, |
201 bool recordPreGCUsage, | 213 bool recordPreGCUsage, |
202 bool recordPeakUsage, | 214 bool recordPeakUsage, |
203 bool recordPostGCUsage, | 215 bool recordPostGCUsage, |
204 bool recordAccumulatedGCTime, | 216 bool recordAccumulatedGCTime, |
205 bool recordGCEndTime, | 217 bool recordGCEndTime, |
206 bool countCollection); | 218 bool countCollection); |
207 | 219 |
208 TraceMemoryManagerStats(Generation::Name kind); | 220 TraceMemoryManagerStats(Generation::Name kind, GCCause::Cause cause); |
209 ~TraceMemoryManagerStats(); | 221 ~TraceMemoryManagerStats(); |
210 }; | 222 }; |
211 | 223 |
212 #endif // SHARE_VM_SERVICES_MEMORYSERVICE_HPP | 224 #endif // SHARE_VM_SERVICES_MEMORYSERVICE_HPP |