hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
61 #include "runtime/java.hpp" |
61 #include "runtime/java.hpp" |
62 #include "runtime/orderAccess.inline.hpp" |
62 #include "runtime/orderAccess.inline.hpp" |
63 #include "runtime/vmThread.hpp" |
63 #include "runtime/vmThread.hpp" |
64 #include "services/memoryService.hpp" |
64 #include "services/memoryService.hpp" |
65 #include "services/runtimeService.hpp" |
65 #include "services/runtimeService.hpp" |
|
66 |
|
67 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC |
66 |
68 |
67 // statics |
69 // statics |
68 CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL; |
70 CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL; |
69 bool CMSCollector::_full_gc_requested = false; |
71 bool CMSCollector::_full_gc_requested = false; |
70 GCCause::Cause CMSCollector::_full_gc_cause = GCCause::_no_gc; |
72 GCCause::Cause CMSCollector::_full_gc_cause = GCCause::_no_gc; |
1180 |
1182 |
1181 if (CMSTraceIncrementalMode) { |
1183 if (CMSTraceIncrementalMode) { |
1182 gclog_or_tty->print(" icms alloc limits: " |
1184 gclog_or_tty->print(" icms alloc limits: " |
1183 PTR_FORMAT "," PTR_FORMAT |
1185 PTR_FORMAT "," PTR_FORMAT |
1184 " (" SIZE_FORMAT "%%," SIZE_FORMAT "%%) ", |
1186 " (" SIZE_FORMAT "%%," SIZE_FORMAT "%%) ", |
1185 _icms_start_limit, _icms_stop_limit, |
1187 p2i(_icms_start_limit), p2i(_icms_stop_limit), |
1186 percent_of_space(eden, _icms_start_limit), |
1188 percent_of_space(eden, _icms_start_limit), |
1187 percent_of_space(eden, _icms_stop_limit)); |
1189 percent_of_space(eden, _icms_stop_limit)); |
1188 if (Verbose) { |
1190 if (Verbose) { |
1189 gclog_or_tty->print("eden: "); |
1191 gclog_or_tty->print("eden: "); |
1190 eden->print_on(gclog_or_tty); |
1192 eden->print_on(gclog_or_tty); |
1208 space->print_on(gclog_or_tty); |
1210 space->print_on(gclog_or_tty); |
1209 gclog_or_tty->stamp(); |
1211 gclog_or_tty->stamp(); |
1210 gclog_or_tty->print_cr(" start limit top=" PTR_FORMAT |
1212 gclog_or_tty->print_cr(" start limit top=" PTR_FORMAT |
1211 ", new limit=" PTR_FORMAT |
1213 ", new limit=" PTR_FORMAT |
1212 " (" SIZE_FORMAT "%%)", |
1214 " (" SIZE_FORMAT "%%)", |
1213 top, _icms_stop_limit, |
1215 p2i(top), p2i(_icms_stop_limit), |
1214 percent_of_space(space, _icms_stop_limit)); |
1216 percent_of_space(space, _icms_stop_limit)); |
1215 } |
1217 } |
1216 ConcurrentMarkSweepThread::start_icms(); |
1218 ConcurrentMarkSweepThread::start_icms(); |
1217 assert(top < _icms_stop_limit, "Tautology"); |
1219 assert(top < _icms_stop_limit, "Tautology"); |
1218 if (word_size < pointer_delta(_icms_stop_limit, top)) { |
1220 if (word_size < pointer_delta(_icms_stop_limit, top)) { |
1225 space->print_on(gclog_or_tty); |
1227 space->print_on(gclog_or_tty); |
1226 gclog_or_tty->stamp(); |
1228 gclog_or_tty->stamp(); |
1227 gclog_or_tty->print_cr(" +stop limit top=" PTR_FORMAT |
1229 gclog_or_tty->print_cr(" +stop limit top=" PTR_FORMAT |
1228 ", new limit=" PTR_FORMAT |
1230 ", new limit=" PTR_FORMAT |
1229 " (" SIZE_FORMAT "%%)", |
1231 " (" SIZE_FORMAT "%%)", |
1230 top, space->end(), |
1232 p2i(top), p2i(space->end()), |
1231 percent_of_space(space, space->end())); |
1233 percent_of_space(space, space->end())); |
1232 } |
1234 } |
1233 ConcurrentMarkSweepThread::stop_icms(); |
1235 ConcurrentMarkSweepThread::stop_icms(); |
1234 return space->end(); |
1236 return space->end(); |
1235 } |
1237 } |
1500 // Print out lots of information which affects the initiation of |
1502 // Print out lots of information which affects the initiation of |
1501 // a collection. |
1503 // a collection. |
1502 if (PrintCMSInitiationStatistics && stats().valid()) { |
1504 if (PrintCMSInitiationStatistics && stats().valid()) { |
1503 gclog_or_tty->print("CMSCollector shouldConcurrentCollect: "); |
1505 gclog_or_tty->print("CMSCollector shouldConcurrentCollect: "); |
1504 gclog_or_tty->stamp(); |
1506 gclog_or_tty->stamp(); |
1505 gclog_or_tty->print_cr(""); |
1507 gclog_or_tty->cr(); |
1506 stats().print_on(gclog_or_tty); |
1508 stats().print_on(gclog_or_tty); |
1507 gclog_or_tty->print_cr("time_until_cms_gen_full %3.7f", |
1509 gclog_or_tty->print_cr("time_until_cms_gen_full %3.7f", |
1508 stats().time_until_cms_gen_full()); |
1510 stats().time_until_cms_gen_full()); |
1509 gclog_or_tty->print_cr("free="SIZE_FORMAT, _cmsGen->free()); |
1511 gclog_or_tty->print_cr("free="SIZE_FORMAT, _cmsGen->free()); |
1510 gclog_or_tty->print_cr("contiguous_available="SIZE_FORMAT, |
1512 gclog_or_tty->print_cr("contiguous_available="SIZE_FORMAT, |
3586 gclog_or_tty->stamp(PrintGCTimeStamps); |
3588 gclog_or_tty->stamp(PrintGCTimeStamps); |
3587 gclog_or_tty->print("[%s-concurrent-%s: %3.3f/%3.3f secs]", |
3589 gclog_or_tty->print("[%s-concurrent-%s: %3.3f/%3.3f secs]", |
3588 _collector->cmsGen()->short_name(), |
3590 _collector->cmsGen()->short_name(), |
3589 _phase, _collector->timerValue(), _wallclock.seconds()); |
3591 _phase, _collector->timerValue(), _wallclock.seconds()); |
3590 if (_print_cr) { |
3592 if (_print_cr) { |
3591 gclog_or_tty->print_cr(""); |
3593 gclog_or_tty->cr(); |
3592 } |
3594 } |
3593 if (PrintCMSStatistics != 0) { |
3595 if (PrintCMSStatistics != 0) { |
3594 gclog_or_tty->print_cr(" (CMS-concurrent-%s yielded %d times)", _phase, |
3596 gclog_or_tty->print_cr(" (CMS-concurrent-%s yielded %d times)", _phase, |
3595 _collector->yields()); |
3597 _collector->yields()); |
3596 } |
3598 } |