Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.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 | 9d679effd28c |
children | da91efe96a93 |
comparison
equal
deleted
inserted
replaced
6174:74533f63b116 | 6197:d2a62e0f25eb |
---|---|
51 #include "runtime/fprofiler.hpp" | 51 #include "runtime/fprofiler.hpp" |
52 #include "runtime/safepoint.hpp" | 52 #include "runtime/safepoint.hpp" |
53 #include "runtime/vmThread.hpp" | 53 #include "runtime/vmThread.hpp" |
54 #include "services/management.hpp" | 54 #include "services/management.hpp" |
55 #include "services/memoryService.hpp" | 55 #include "services/memoryService.hpp" |
56 #include "services/memTracker.hpp" | |
56 #include "utilities/events.hpp" | 57 #include "utilities/events.hpp" |
57 #include "utilities/stack.inline.hpp" | 58 #include "utilities/stack.inline.hpp" |
58 | 59 |
59 #include <math.h> | 60 #include <math.h> |
60 | 61 |
403 const size_t rs_align = page_sz == (size_t) os::vm_page_size() ? 0 : | 404 const size_t rs_align = page_sz == (size_t) os::vm_page_size() ? 0 : |
404 MAX2(page_sz, granularity); | 405 MAX2(page_sz, granularity); |
405 ReservedSpace rs(bytes, rs_align, rs_align > 0); | 406 ReservedSpace rs(bytes, rs_align, rs_align > 0); |
406 os::trace_page_sizes("par compact", raw_bytes, raw_bytes, page_sz, rs.base(), | 407 os::trace_page_sizes("par compact", raw_bytes, raw_bytes, page_sz, rs.base(), |
407 rs.size()); | 408 rs.size()); |
409 | |
410 MemTracker::record_virtual_memory_type((address)rs.base(), mtGC); | |
411 | |
408 PSVirtualSpace* vspace = new PSVirtualSpace(rs, page_sz); | 412 PSVirtualSpace* vspace = new PSVirtualSpace(rs, page_sz); |
409 if (vspace != 0) { | 413 if (vspace != 0) { |
410 if (vspace->expand_by(bytes)) { | 414 if (vspace->expand_by(bytes)) { |
411 return vspace; | 415 return vspace; |
412 } | 416 } |
2730 SystemDictionary::number_of_classes()); | 2734 SystemDictionary::number_of_classes()); |
2731 } | 2735 } |
2732 for (uint i = 0; i < ParallelGCThreads + 1; i++) { | 2736 for (uint i = 0; i < ParallelGCThreads + 1; i++) { |
2733 ParCompactionManager* cm = ParCompactionManager::manager_array(i); | 2737 ParCompactionManager* cm = ParCompactionManager::manager_array(i); |
2734 KeepAliveClosure keep_alive_closure(cm); | 2738 KeepAliveClosure keep_alive_closure(cm); |
2735 Stack<Klass*>* const rks = cm->revisit_klass_stack(); | 2739 Stack<Klass*, mtGC>* const rks = cm->revisit_klass_stack(); |
2736 if (PrintRevisitStats) { | 2740 if (PrintRevisitStats) { |
2737 gclog_or_tty->print_cr("Revisit klass stack[%u] length = " SIZE_FORMAT, | 2741 gclog_or_tty->print_cr("Revisit klass stack[%u] length = " SIZE_FORMAT, |
2738 i, rks->size()); | 2742 i, rks->size()); |
2739 } | 2743 } |
2740 while (!rks->is_empty()) { | 2744 while (!rks->is_empty()) { |
2763 gclog_or_tty->print_cr("#classes in system dictionary = %d", | 2767 gclog_or_tty->print_cr("#classes in system dictionary = %d", |
2764 SystemDictionary::number_of_classes()); | 2768 SystemDictionary::number_of_classes()); |
2765 } | 2769 } |
2766 for (uint i = 0; i < ParallelGCThreads + 1; i++) { | 2770 for (uint i = 0; i < ParallelGCThreads + 1; i++) { |
2767 ParCompactionManager* cm = ParCompactionManager::manager_array(i); | 2771 ParCompactionManager* cm = ParCompactionManager::manager_array(i); |
2768 Stack<DataLayout*>* rms = cm->revisit_mdo_stack(); | 2772 Stack<DataLayout*, mtGC>* rms = cm->revisit_mdo_stack(); |
2769 if (PrintRevisitStats) { | 2773 if (PrintRevisitStats) { |
2770 gclog_or_tty->print_cr("Revisit MDO stack[%u] size = " SIZE_FORMAT, | 2774 gclog_or_tty->print_cr("Revisit MDO stack[%u] size = " SIZE_FORMAT, |
2771 i, rms->size()); | 2775 i, rms->size()); |
2772 } | 2776 } |
2773 while (!rms->is_empty()) { | 2777 while (!rms->is_empty()) { |