Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 3914:20213c8a3c40
7050392: G1: Introduce flag to generate a log of the G1 ergonomic decisions
Summary: It introduces ergonomic decision logging in G1 for the following heuristics: heap sizing, collection set construction, concurrent cycle initiation, and partially-young GC start/end. The code has a bit of refactoring in a few places to make the decision logging possible. It also replaces alternative ad-hoc logging that we have under different parameters and switches (G1_DEBUG, G1PolicyVerbose).
Reviewed-by: johnc, ysr
author | tonyp |
---|---|
date | Wed, 07 Sep 2011 12:21:23 -0400 |
parents | ff53346271fe |
children | 1847b501ae74 |
comparison
equal
deleted
inserted
replaced
3913:27702f012017 | 3914:20213c8a3c40 |
---|---|
26 #include "classfile/symbolTable.hpp" | 26 #include "classfile/symbolTable.hpp" |
27 #include "gc_implementation/g1/concurrentMark.inline.hpp" | 27 #include "gc_implementation/g1/concurrentMark.inline.hpp" |
28 #include "gc_implementation/g1/concurrentMarkThread.inline.hpp" | 28 #include "gc_implementation/g1/concurrentMarkThread.inline.hpp" |
29 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" | 29 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" |
30 #include "gc_implementation/g1/g1CollectorPolicy.hpp" | 30 #include "gc_implementation/g1/g1CollectorPolicy.hpp" |
31 #include "gc_implementation/g1/g1ErgoVerbose.hpp" | |
31 #include "gc_implementation/g1/g1OopClosures.inline.hpp" | 32 #include "gc_implementation/g1/g1OopClosures.inline.hpp" |
32 #include "gc_implementation/g1/g1RemSet.hpp" | 33 #include "gc_implementation/g1/g1RemSet.hpp" |
33 #include "gc_implementation/g1/heapRegionRemSet.hpp" | 34 #include "gc_implementation/g1/heapRegionRemSet.hpp" |
34 #include "gc_implementation/g1/heapRegionSeq.inline.hpp" | 35 #include "gc_implementation/g1/heapRegionSeq.inline.hpp" |
35 #include "gc_implementation/shared/vmGCOperations.hpp" | 36 #include "gc_implementation/shared/vmGCOperations.hpp" |
1725 g1_par_count_task.work(0); | 1726 g1_par_count_task.work(0); |
1726 } | 1727 } |
1727 | 1728 |
1728 size_t known_garbage_bytes = | 1729 size_t known_garbage_bytes = |
1729 g1_par_count_task.used_bytes() - g1_par_count_task.live_bytes(); | 1730 g1_par_count_task.used_bytes() - g1_par_count_task.live_bytes(); |
1730 #if 0 | |
1731 gclog_or_tty->print_cr("used %1.2lf, live %1.2lf, garbage %1.2lf", | |
1732 (double) g1_par_count_task.used_bytes() / (double) (1024 * 1024), | |
1733 (double) g1_par_count_task.live_bytes() / (double) (1024 * 1024), | |
1734 (double) known_garbage_bytes / (double) (1024 * 1024)); | |
1735 #endif // 0 | |
1736 g1p->set_known_garbage_bytes(known_garbage_bytes); | 1731 g1p->set_known_garbage_bytes(known_garbage_bytes); |
1737 | 1732 |
1738 size_t start_used_bytes = g1h->used(); | 1733 size_t start_used_bytes = g1h->used(); |
1739 _at_least_one_mark_complete = true; | 1734 _at_least_one_mark_complete = true; |
1740 g1h->set_marking_complete(); | 1735 g1h->set_marking_complete(); |
1736 | |
1737 ergo_verbose4(ErgoConcCycles, | |
1738 "finish cleanup", | |
1739 ergo_format_byte("occupancy") | |
1740 ergo_format_byte("capacity") | |
1741 ergo_format_byte_perc("known garbage"), | |
1742 start_used_bytes, g1h->capacity(), | |
1743 known_garbage_bytes, | |
1744 ((double) known_garbage_bytes / (double) g1h->capacity()) * 100.0); | |
1741 | 1745 |
1742 double count_end = os::elapsedTime(); | 1746 double count_end = os::elapsedTime(); |
1743 double this_final_counting_time = (count_end - start); | 1747 double this_final_counting_time = (count_end - start); |
1744 if (G1PrintParCleanupStats) { | 1748 if (G1PrintParCleanupStats) { |
1745 gclog_or_tty->print_cr("Cleanup:"); | 1749 gclog_or_tty->print_cr("Cleanup:"); |