Mercurial > hg > truffle
comparison src/share/vm/services/threadService.hpp @ 6197:d2a62e0f25eb
6995781: Native Memory Tracking (Phase 1)
7151532: DCmd for hotspot native memory tracking
Summary: Implementation of native memory tracking phase 1, which tracks VM native memory usage, and related DCmd
Reviewed-by: acorn, coleenp, fparain
author | zgu |
---|---|
date | Thu, 28 Jun 2012 17:03:16 -0400 |
parents | b1a2afa37ec4 |
children | da91efe96a93 |
comparison
equal
deleted
inserted
replaced
6174:74533f63b116 | 6197:d2a62e0f25eb |
---|---|
114 // GC support | 114 // GC support |
115 static void oops_do(OopClosure* f); | 115 static void oops_do(OopClosure* f); |
116 }; | 116 }; |
117 | 117 |
118 // Per-thread Statistics for synchronization | 118 // Per-thread Statistics for synchronization |
119 class ThreadStatistics : public CHeapObj { | 119 class ThreadStatistics : public CHeapObj<mtInternal> { |
120 private: | 120 private: |
121 // The following contention statistics are only updated by | 121 // The following contention statistics are only updated by |
122 // the thread owning these statistics when contention occurs. | 122 // the thread owning these statistics when contention occurs. |
123 | 123 |
124 jlong _contended_enter_count; | 124 jlong _contended_enter_count; |
184 int* perf_recursion_counts_addr() { return _perf_recursion_counts; } | 184 int* perf_recursion_counts_addr() { return _perf_recursion_counts; } |
185 elapsedTimer* perf_timers_addr() { return _perf_timers; } | 185 elapsedTimer* perf_timers_addr() { return _perf_timers; } |
186 }; | 186 }; |
187 | 187 |
188 // Thread snapshot to represent the thread state and statistics | 188 // Thread snapshot to represent the thread state and statistics |
189 class ThreadSnapshot : public CHeapObj { | 189 class ThreadSnapshot : public CHeapObj<mtInternal> { |
190 private: | 190 private: |
191 JavaThread* _thread; | 191 JavaThread* _thread; |
192 oop _threadObj; | 192 oop _threadObj; |
193 java_lang_Thread::ThreadStatus _thread_status; | 193 java_lang_Thread::ThreadStatus _thread_status; |
194 | 194 |
242 void dump_stack_at_safepoint(int max_depth, bool with_locked_monitors); | 242 void dump_stack_at_safepoint(int max_depth, bool with_locked_monitors); |
243 void set_concurrent_locks(ThreadConcurrentLocks* l) { _concurrent_locks = l; } | 243 void set_concurrent_locks(ThreadConcurrentLocks* l) { _concurrent_locks = l; } |
244 void oops_do(OopClosure* f); | 244 void oops_do(OopClosure* f); |
245 }; | 245 }; |
246 | 246 |
247 class ThreadStackTrace : public CHeapObj { | 247 class ThreadStackTrace : public CHeapObj<mtInternal> { |
248 private: | 248 private: |
249 JavaThread* _thread; | 249 JavaThread* _thread; |
250 int _depth; // number of stack frames added | 250 int _depth; // number of stack frames added |
251 bool _with_locked_monitors; | 251 bool _with_locked_monitors; |
252 GrowableArray<StackFrameInfo*>* _frames; | 252 GrowableArray<StackFrameInfo*>* _frames; |
273 }; | 273 }; |
274 | 274 |
275 // StackFrameInfo for keeping methodOop and bci during | 275 // StackFrameInfo for keeping methodOop and bci during |
276 // stack walking for later construction of StackTraceElement[] | 276 // stack walking for later construction of StackTraceElement[] |
277 // Java instances | 277 // Java instances |
278 class StackFrameInfo : public CHeapObj { | 278 class StackFrameInfo : public CHeapObj<mtInternal> { |
279 private: | 279 private: |
280 methodOop _method; | 280 methodOop _method; |
281 int _bci; | 281 int _bci; |
282 GrowableArray<oop>* _locked_monitors; // list of object monitors locked by this frame | 282 GrowableArray<oop>* _locked_monitors; // list of object monitors locked by this frame |
283 | 283 |
297 GrowableArray<oop>* locked_monitors() { return _locked_monitors; } | 297 GrowableArray<oop>* locked_monitors() { return _locked_monitors; } |
298 | 298 |
299 void print_on(outputStream* st) const; | 299 void print_on(outputStream* st) const; |
300 }; | 300 }; |
301 | 301 |
302 class ThreadConcurrentLocks : public CHeapObj { | 302 class ThreadConcurrentLocks : public CHeapObj<mtInternal> { |
303 private: | 303 private: |
304 GrowableArray<instanceOop>* _owned_locks; | 304 GrowableArray<instanceOop>* _owned_locks; |
305 ThreadConcurrentLocks* _next; | 305 ThreadConcurrentLocks* _next; |
306 JavaThread* _thread; | 306 JavaThread* _thread; |
307 public: | 307 public: |
354 int num_snapshots() { return _num_snapshots; } | 354 int num_snapshots() { return _num_snapshots; } |
355 ThreadSnapshot* snapshots() { return _snapshots; } | 355 ThreadSnapshot* snapshots() { return _snapshots; } |
356 void oops_do(OopClosure* f); | 356 void oops_do(OopClosure* f); |
357 }; | 357 }; |
358 | 358 |
359 class DeadlockCycle : public CHeapObj { | 359 class DeadlockCycle : public CHeapObj<mtInternal> { |
360 private: | 360 private: |
361 bool _is_deadlock; | 361 bool _is_deadlock; |
362 GrowableArray<JavaThread*>* _threads; | 362 GrowableArray<JavaThread*>* _threads; |
363 DeadlockCycle* _next; | 363 DeadlockCycle* _next; |
364 public: | 364 public: |