< prev index next >

src/share/vm/gc/g1/g1CollectorPolicy.cpp

Print this page
rev 9489 : 8143251: HeapRetentionTest.java Test is failing on jdk9/dev
Reviewed-by: tschatzl, david
rev 9490 : [mq]: 9489-fix


1725   // initial-mark pause).
1726   assert(!collector_state()->during_initial_mark_pause(), "pre-condition");
1727 
1728   if (collector_state()->initiate_conc_mark_if_possible()) {
1729     // We had noticed on a previous pause that the heap occupancy has
1730     // gone over the initiating threshold and we should start a
1731     // concurrent marking cycle. So we might initiate one.
1732 
1733     if (!about_to_start_mixed_phase() && collector_state()->gcs_are_young()) {
1734       // Initiate a new initial mark if there is no marking or reclamation going on.
1735       initiate_conc_mark();
1736       ergo_verbose0(ErgoConcCycles,
1737                     "initiate concurrent cycle",
1738                     ergo_format_reason("concurrent cycle initiation requested"));
1739     } else if (_g1->is_user_requested_concurrent_full_gc(_g1->gc_cause())) {
1740       // Initiate a user requested initial mark. An initial mark must be young only
1741       // GC, so the collector state must be updated to reflect this.
1742       collector_state()->set_gcs_are_young(true);
1743       collector_state()->set_last_young_gc(false);
1744 

1745       initiate_conc_mark();
1746       ergo_verbose0(ErgoConcCycles,
1747                     "initiate concurrent cycle",
1748                     ergo_format_reason("user requested concurrent cycle"));
1749     } else {
1750       // The concurrent marking thread is still finishing up the
1751       // previous cycle. If we start one right now the two cycles
1752       // overlap. In particular, the concurrent marking thread might
1753       // be in the process of clearing the next marking bitmap (which
1754       // we will use for the next cycle if we start one). Starting a
1755       // cycle now will be bad given that parts of the marking
1756       // information might get cleared by the marking thread. And we
1757       // cannot wait for the marking thread to finish the cycle as it
1758       // periodically yields while clearing the next marking bitmap
1759       // and, if it's in a yield point, it's waiting for us to
1760       // finish. So, at this point we will not start a cycle and we'll
1761       // let the concurrent marking thread complete the last one.
1762       ergo_verbose0(ErgoConcCycles,
1763                     "do not initiate concurrent cycle",
1764                     ergo_format_reason("concurrent cycle already in progress"));




1725   // initial-mark pause).
1726   assert(!collector_state()->during_initial_mark_pause(), "pre-condition");
1727 
1728   if (collector_state()->initiate_conc_mark_if_possible()) {
1729     // We had noticed on a previous pause that the heap occupancy has
1730     // gone over the initiating threshold and we should start a
1731     // concurrent marking cycle. So we might initiate one.
1732 
1733     if (!about_to_start_mixed_phase() && collector_state()->gcs_are_young()) {
1734       // Initiate a new initial mark if there is no marking or reclamation going on.
1735       initiate_conc_mark();
1736       ergo_verbose0(ErgoConcCycles,
1737                     "initiate concurrent cycle",
1738                     ergo_format_reason("concurrent cycle initiation requested"));
1739     } else if (_g1->is_user_requested_concurrent_full_gc(_g1->gc_cause())) {
1740       // Initiate a user requested initial mark. An initial mark must be young only
1741       // GC, so the collector state must be updated to reflect this.
1742       collector_state()->set_gcs_are_young(true);
1743       collector_state()->set_last_young_gc(false);
1744 
1745       abort_time_to_mixed_tracking();
1746       initiate_conc_mark();
1747       ergo_verbose0(ErgoConcCycles,
1748                     "initiate concurrent cycle",
1749                     ergo_format_reason("user requested concurrent cycle"));
1750     } else {
1751       // The concurrent marking thread is still finishing up the
1752       // previous cycle. If we start one right now the two cycles
1753       // overlap. In particular, the concurrent marking thread might
1754       // be in the process of clearing the next marking bitmap (which
1755       // we will use for the next cycle if we start one). Starting a
1756       // cycle now will be bad given that parts of the marking
1757       // information might get cleared by the marking thread. And we
1758       // cannot wait for the marking thread to finish the cycle as it
1759       // periodically yields while clearing the next marking bitmap
1760       // and, if it's in a yield point, it's waiting for us to
1761       // finish. So, at this point we will not start a cycle and we'll
1762       // let the concurrent marking thread complete the last one.
1763       ergo_verbose0(ErgoConcCycles,
1764                     "do not initiate concurrent cycle",
1765                     ergo_format_reason("concurrent cycle already in progress"));


< prev index next >