16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "gc/parallel/gcTaskManager.hpp"
27 #include "gc/parallel/mutableSpace.hpp"
28 #include "gc/parallel/parallelScavengeHeap.hpp"
29 #include "gc/parallel/psOldGen.hpp"
30 #include "gc/parallel/psPromotionManager.inline.hpp"
31 #include "gc/parallel/psScavenge.inline.hpp"
32 #include "gc/shared/gcTrace.hpp"
33 #include "gc/shared/preservedMarks.inline.hpp"
34 #include "gc/shared/taskqueue.inline.hpp"
35 #include "logging/log.hpp"
36 #include "memory/allocation.inline.hpp"
37 #include "memory/memRegion.hpp"
38 #include "memory/padded.inline.hpp"
39 #include "memory/resourceArea.hpp"
40 #include "oops/instanceKlass.inline.hpp"
41 #include "oops/instanceMirrorKlass.inline.hpp"
42 #include "oops/objArrayKlass.inline.hpp"
43 #include "oops/oop.inline.hpp"
44
45 PaddedEnd<PSPromotionManager>* PSPromotionManager::_manager_array = NULL;
46 OopStarTaskQueueSet* PSPromotionManager::_stack_array_depth = NULL;
47 PreservedMarksSet* PSPromotionManager::_preserved_marks_set = NULL;
48 PSOldGen* PSPromotionManager::_old_gen = NULL;
49 MutableSpace* PSPromotionManager::_young_space = NULL;
50
51 void PSPromotionManager::initialize() {
52 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
53
54 _old_gen = heap->old_gen();
55 _young_space = heap->young_gen()->to_space();
138 PSPromotionManager::print_local_stats(outputStream* const out, uint i) const {
139 #define FMT " " SIZE_FORMAT_W(10)
140 out->print_cr("%3u" FMT FMT FMT FMT, i, _masked_pushes, _masked_steals,
141 _arrays_chunked, _array_chunks_processed);
142 #undef FMT
143 }
144
145 static const char* const pm_stats_hdr[] = {
146 " --------masked------- arrays array",
147 "thr push steal chunked chunks",
148 "--- ---------- ---------- ---------- ----------"
149 };
150
151 void
152 PSPromotionManager::print_taskqueue_stats() {
153 if (!log_develop_is_enabled(Trace, gc, task, stats)) {
154 return;
155 }
156 Log(gc, task, stats) log;
157 ResourceMark rm;
158 outputStream* out = log.trace_stream();
159 out->print_cr("== GC Tasks Stats, GC %3d",
160 ParallelScavengeHeap::heap()->total_collections());
161
162 TaskQueueStats totals;
163 out->print("thr "); TaskQueueStats::print_header(1, out); out->cr();
164 out->print("--- "); TaskQueueStats::print_header(2, out); out->cr();
165 for (uint i = 0; i < ParallelGCThreads + 1; ++i) {
166 TaskQueueStats& next = manager_array(i)->_claimed_stack_depth.stats;
167 out->print("%3d ", i); next.print(out); out->cr();
168 totals += next;
169 }
170 out->print("tot "); totals.print(out); out->cr();
171
172 const uint hlines = sizeof(pm_stats_hdr) / sizeof(pm_stats_hdr[0]);
173 for (uint i = 0; i < hlines; ++i) out->print_cr("%s", pm_stats_hdr[i]);
174 for (uint i = 0; i < ParallelGCThreads + 1; ++i) {
175 manager_array(i)->print_local_stats(out, i);
176 }
177 }
178
|
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "gc/parallel/gcTaskManager.hpp"
27 #include "gc/parallel/mutableSpace.hpp"
28 #include "gc/parallel/parallelScavengeHeap.hpp"
29 #include "gc/parallel/psOldGen.hpp"
30 #include "gc/parallel/psPromotionManager.inline.hpp"
31 #include "gc/parallel/psScavenge.inline.hpp"
32 #include "gc/shared/gcTrace.hpp"
33 #include "gc/shared/preservedMarks.inline.hpp"
34 #include "gc/shared/taskqueue.inline.hpp"
35 #include "logging/log.hpp"
36 #include "logging/logStream.hpp"
37 #include "memory/allocation.inline.hpp"
38 #include "memory/memRegion.hpp"
39 #include "memory/padded.inline.hpp"
40 #include "memory/resourceArea.hpp"
41 #include "oops/instanceKlass.inline.hpp"
42 #include "oops/instanceMirrorKlass.inline.hpp"
43 #include "oops/objArrayKlass.inline.hpp"
44 #include "oops/oop.inline.hpp"
45
46 PaddedEnd<PSPromotionManager>* PSPromotionManager::_manager_array = NULL;
47 OopStarTaskQueueSet* PSPromotionManager::_stack_array_depth = NULL;
48 PreservedMarksSet* PSPromotionManager::_preserved_marks_set = NULL;
49 PSOldGen* PSPromotionManager::_old_gen = NULL;
50 MutableSpace* PSPromotionManager::_young_space = NULL;
51
52 void PSPromotionManager::initialize() {
53 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
54
55 _old_gen = heap->old_gen();
56 _young_space = heap->young_gen()->to_space();
139 PSPromotionManager::print_local_stats(outputStream* const out, uint i) const {
140 #define FMT " " SIZE_FORMAT_W(10)
141 out->print_cr("%3u" FMT FMT FMT FMT, i, _masked_pushes, _masked_steals,
142 _arrays_chunked, _array_chunks_processed);
143 #undef FMT
144 }
145
146 static const char* const pm_stats_hdr[] = {
147 " --------masked------- arrays array",
148 "thr push steal chunked chunks",
149 "--- ---------- ---------- ---------- ----------"
150 };
151
152 void
153 PSPromotionManager::print_taskqueue_stats() {
154 if (!log_develop_is_enabled(Trace, gc, task, stats)) {
155 return;
156 }
157 Log(gc, task, stats) log;
158 ResourceMark rm;
159 LogStream ls(log.trace());
160 outputStream* out = &ls;
161 out->print_cr("== GC Tasks Stats, GC %3d",
162 ParallelScavengeHeap::heap()->total_collections());
163
164 TaskQueueStats totals;
165 out->print("thr "); TaskQueueStats::print_header(1, out); out->cr();
166 out->print("--- "); TaskQueueStats::print_header(2, out); out->cr();
167 for (uint i = 0; i < ParallelGCThreads + 1; ++i) {
168 TaskQueueStats& next = manager_array(i)->_claimed_stack_depth.stats;
169 out->print("%3d ", i); next.print(out); out->cr();
170 totals += next;
171 }
172 out->print("tot "); totals.print(out); out->cr();
173
174 const uint hlines = sizeof(pm_stats_hdr) / sizeof(pm_stats_hdr[0]);
175 for (uint i = 0; i < hlines; ++i) out->print_cr("%s", pm_stats_hdr[i]);
176 for (uint i = 0; i < ParallelGCThreads + 1; ++i) {
177 manager_array(i)->print_local_stats(out, i);
178 }
179 }
180
|