comparison src/share/vm/services/threadService.cpp @ 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 8a63c6323842
children da91efe96a93
comparison
equal deleted inserted replaced
6174:74533f63b116 6197:d2a62e0f25eb
435 if (with_lock_info) { 435 if (with_lock_info) {
436 ResourceMark rm; 436 ResourceMark rm;
437 GrowableArray<MonitorInfo*>* list = jvf->locked_monitors(); 437 GrowableArray<MonitorInfo*>* list = jvf->locked_monitors();
438 int length = list->length(); 438 int length = list->length();
439 if (length > 0) { 439 if (length > 0) {
440 _locked_monitors = new (ResourceObj::C_HEAP) GrowableArray<oop>(length, true); 440 _locked_monitors = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<oop>(length, true);
441 for (int i = 0; i < length; i++) { 441 for (int i = 0; i < length; i++) {
442 MonitorInfo* monitor = list->at(i); 442 MonitorInfo* monitor = list->at(i);
443 assert(monitor->owner(), "This monitor must have an owning object"); 443 assert(monitor->owner(), "This monitor must have an owning object");
444 _locked_monitors->append(monitor->owner()); 444 _locked_monitors->append(monitor->owner());
445 } 445 }
489 } 489 }
490 }; 490 };
491 491
492 ThreadStackTrace::ThreadStackTrace(JavaThread* t, bool with_locked_monitors) { 492 ThreadStackTrace::ThreadStackTrace(JavaThread* t, bool with_locked_monitors) {
493 _thread = t; 493 _thread = t;
494 _frames = new (ResourceObj::C_HEAP) GrowableArray<StackFrameInfo*>(INITIAL_ARRAY_SIZE, true); 494 _frames = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<StackFrameInfo*>(INITIAL_ARRAY_SIZE, true);
495 _depth = 0; 495 _depth = 0;
496 _with_locked_monitors = with_locked_monitors; 496 _with_locked_monitors = with_locked_monitors;
497 if (_with_locked_monitors) { 497 if (_with_locked_monitors) {
498 _jni_locked_monitors = new (ResourceObj::C_HEAP) GrowableArray<oop>(INITIAL_ARRAY_SIZE, true); 498 _jni_locked_monitors = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<oop>(INITIAL_ARRAY_SIZE, true);
499 } else { 499 } else {
500 _jni_locked_monitors = NULL; 500 _jni_locked_monitors = NULL;
501 } 501 }
502 } 502 }
503 503
687 st->cr(); 687 st->cr();
688 } 688 }
689 689
690 ThreadConcurrentLocks::ThreadConcurrentLocks(JavaThread* thread) { 690 ThreadConcurrentLocks::ThreadConcurrentLocks(JavaThread* thread) {
691 _thread = thread; 691 _thread = thread;
692 _owned_locks = new (ResourceObj::C_HEAP) GrowableArray<instanceOop>(INITIAL_ARRAY_SIZE, true); 692 _owned_locks = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<instanceOop>(INITIAL_ARRAY_SIZE, true);
693 _next = NULL; 693 _next = NULL;
694 } 694 }
695 695
696 ThreadConcurrentLocks::~ThreadConcurrentLocks() { 696 ThreadConcurrentLocks::~ThreadConcurrentLocks() {
697 delete _owned_locks; 697 delete _owned_locks;
801 } 801 }
802 } 802 }
803 803
804 DeadlockCycle::DeadlockCycle() { 804 DeadlockCycle::DeadlockCycle() {
805 _is_deadlock = false; 805 _is_deadlock = false;
806 _threads = new (ResourceObj::C_HEAP) GrowableArray<JavaThread*>(INITIAL_ARRAY_SIZE, true); 806 _threads = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<JavaThread*>(INITIAL_ARRAY_SIZE, true);
807 _next = NULL; 807 _next = NULL;
808 } 808 }
809 809
810 DeadlockCycle::~DeadlockCycle() { 810 DeadlockCycle::~DeadlockCycle() {
811 delete _threads; 811 delete _threads;