hotspot/src/share/vm/memory/genCollectedHeap.hpp
changeset 7419 263dd4e89b9d
parent 7397 5b173b4ca846
child 9342 456b8d0486b5
equal deleted inserted replaced
7418:ca00dd5fcae0 7419:263dd4e89b9d
   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 {