1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Tue Jul 29 10:26:09 2014 +0200 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Thu Jul 31 09:23:24 2014 +0200 1.3 @@ -6477,6 +6477,9 @@ 1.4 1.5 G1CollectedHeap* g1h = G1CollectedHeap::heap(); 1.6 1.7 + oop obj = (oop)r->bottom(); 1.8 + CMBitMap* next_bitmap = g1h->concurrent_mark()->nextMarkBitMap(); 1.9 + 1.10 // The following checks whether the humongous object is live are sufficient. 1.11 // The main additional check (in addition to having a reference from the roots 1.12 // or the young gen) is whether the humongous object has a remembered set entry. 1.13 @@ -6513,37 +6516,41 @@ 1.14 g1h->humongous_region_is_always_live(region_idx)) { 1.15 1.16 if (G1TraceReclaimDeadHumongousObjectsAtYoungGC) { 1.17 - gclog_or_tty->print_cr("Live humongous %d region %d with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is dead-bitmap %d live-other %d obj array %d", 1.18 + gclog_or_tty->print_cr("Live humongous %d region %d with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is marked %d live-other %d obj array %d", 1.19 r->isHumongous(), 1.20 region_idx, 1.21 r->rem_set()->occupied(), 1.22 r->rem_set()->strong_code_roots_list_length(), 1.23 - g1h->mark_in_progress() && !g1h->g1_policy()->during_initial_mark_pause(), 1.24 + next_bitmap->isMarked(r->bottom()), 1.25 g1h->humongous_is_live(region_idx), 1.26 - oop(r->bottom())->is_objArray() 1.27 + obj->is_objArray() 1.28 ); 1.29 } 1.30 1.31 return false; 1.32 } 1.33 1.34 - guarantee(!((oop)(r->bottom()))->is_objArray(), 1.35 + guarantee(!obj->is_objArray(), 1.36 err_msg("Eagerly reclaiming object arrays is not supported, but the object "PTR_FORMAT" is.", 1.37 r->bottom())); 1.38 1.39 if (G1TraceReclaimDeadHumongousObjectsAtYoungGC) { 1.40 - gclog_or_tty->print_cr("Reclaim humongous region %d start "PTR_FORMAT" region %d length "UINT32_FORMAT" with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is dead-bitmap %d live-other %d obj array %d", 1.41 + gclog_or_tty->print_cr("Reclaim humongous region %d start "PTR_FORMAT" region %d length "UINT32_FORMAT" with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is marked %d live-other %d obj array %d", 1.42 r->isHumongous(), 1.43 r->bottom(), 1.44 region_idx, 1.45 r->region_num(), 1.46 r->rem_set()->occupied(), 1.47 r->rem_set()->strong_code_roots_list_length(), 1.48 - g1h->mark_in_progress() && !g1h->g1_policy()->during_initial_mark_pause(), 1.49 + next_bitmap->isMarked(r->bottom()), 1.50 g1h->humongous_is_live(region_idx), 1.51 - oop(r->bottom())->is_objArray() 1.52 + obj->is_objArray() 1.53 ); 1.54 } 1.55 + // Need to clear mark bit of the humongous object if already set. 1.56 + if (next_bitmap->isMarked(r->bottom())) { 1.57 + next_bitmap->clear(r->bottom()); 1.58 + } 1.59 _freed_bytes += r->used(); 1.60 r->set_containing_set(NULL); 1.61 _humongous_regions_removed.increment(1u, r->capacity());