comparison src/share/vm/memory/genCollectedHeap.hpp @ 1994:6cd6d394f280

7001033: assert(gch->gc_cause() == GCCause::_scavenge_alot || !gch->incremental_collection_failed()) 7002546: regression on SpecJbb2005 on 7b118 comparing to 7b117 on small heaps Summary: Relaxed assertion checking related to incremental_collection_failed flag to allow for ExplicitGCInvokesConcurrent behaviour where we do not want a failing scavenge to bail to a stop-world collection. Parameterized incremental_collection_will_fail() so we can selectively use, or not use, as appropriate, the statistical prediction at specific use sites. This essentially reverts the scavenge bail-out logic to what it was prior to some recent changes that had inadvertently started using the statistical prediction which can be noisy in the presence of bursty loads. Added some associated verbose non-product debugging messages. Reviewed-by: johnc, tonyp
author ysr
date Tue, 07 Dec 2010 21:55:53 -0800
parents f95d63e2154a
children 1f4413413144
comparison
equal deleted inserted replaced
1993:459fad165e5e 1994:6cd6d394f280
475 // "level" or above (including the permanent generation) since the last 475 // "level" or above (including the permanent generation) since the last
476 // call to "save_marks". 476 // call to "save_marks".
477 bool no_allocs_since_save_marks(int level); 477 bool no_allocs_since_save_marks(int level);
478 478
479 // Returns true if an incremental collection is likely to fail. 479 // Returns true if an incremental collection is likely to fail.
480 bool incremental_collection_will_fail() { 480 // We optionally consult the young gen, if asked to do so;
481 // otherwise we base our answer on whether the previous incremental
482 // collection attempt failed with no corrective action as of yet.
483 bool incremental_collection_will_fail(bool consult_young) {
481 // Assumes a 2-generation system; the first disjunct remembers if an 484 // Assumes a 2-generation system; the first disjunct remembers if an
482 // incremental collection failed, even when we thought (second disjunct) 485 // incremental collection failed, even when we thought (second disjunct)
483 // that it would not. 486 // that it would not.
484 assert(heap()->collector_policy()->is_two_generation_policy(), 487 assert(heap()->collector_policy()->is_two_generation_policy(),
485 "the following definition may not be suitable for an n(>2)-generation system"); 488 "the following definition may not be suitable for an n(>2)-generation system");
486 return incremental_collection_failed() || !get_gen(0)->collection_attempt_is_safe(); 489 return incremental_collection_failed() ||
490 (consult_young && !get_gen(0)->collection_attempt_is_safe());
487 } 491 }
488 492
489 // If a generation bails out of an incremental collection, 493 // If a generation bails out of an incremental collection,
490 // it sets this flag. 494 // it sets this flag.
491 bool incremental_collection_failed() const { 495 bool incremental_collection_failed() const {