comparison src/share/vm/memory/genCollectedHeap.hpp @ 1888:a7214d79fcf1

6896603: CMS/GCH: collection_attempt_is_safe() ergo should use more recent data Summary: Deprecated HandlePromotionFailure, removing the ability to turn off that feature, did away with one epoch look-ahead when deciding if a scavenge is likely to fail, relying on current data. Reviewed-by: jmasa, johnc, poonam
author ysr
date Sat, 23 Oct 2010 23:03:49 -0700
parents 8b10f48633dc
children f95d63e2154a
comparison
equal deleted inserted replaced
1887:cd3ef3fd20dd 1888:a7214d79fcf1
60 GenerationSpec** _gen_specs; 60 GenerationSpec** _gen_specs;
61 61
62 // The generational collector policy. 62 // The generational collector policy.
63 GenCollectorPolicy* _gen_policy; 63 GenCollectorPolicy* _gen_policy;
64 64
65 // If a generation would bail out of an incremental collection, 65 // Indicates that the most recent previous incremental collection failed.
66 // it sets this flag. If the flag is set, satisfy_failed_allocation 66 // The flag is cleared when an action is taken that might clear the
67 // will attempt allocating in all generations before doing a full GC. 67 // condition that caused that incremental collection to fail.
68 bool _incremental_collection_will_fail; 68 bool _incremental_collection_failed;
69 bool _last_incremental_collection_failed;
70 69
71 // In support of ExplicitGCInvokesConcurrent functionality 70 // In support of ExplicitGCInvokesConcurrent functionality
72 unsigned int _full_collections_completed; 71 unsigned int _full_collections_completed;
73 72
74 // Data structure for claiming the (potentially) parallel tasks in 73 // Data structure for claiming the (potentially) parallel tasks in
467 // Returns "true" iff no allocations have occurred in any generation at 466 // Returns "true" iff no allocations have occurred in any generation at
468 // "level" or above (including the permanent generation) since the last 467 // "level" or above (including the permanent generation) since the last
469 // call to "save_marks". 468 // call to "save_marks".
470 bool no_allocs_since_save_marks(int level); 469 bool no_allocs_since_save_marks(int level);
471 470
471 // Returns true if an incremental collection is likely to fail.
472 bool incremental_collection_will_fail() {
473 // Assumes a 2-generation system; the first disjunct remembers if an
474 // incremental collection failed, even when we thought (second disjunct)
475 // that it would not.
476 assert(heap()->collector_policy()->is_two_generation_policy(),
477 "the following definition may not be suitable for an n(>2)-generation system");
478 return incremental_collection_failed() || !get_gen(0)->collection_attempt_is_safe();
479 }
480
472 // If a generation bails out of an incremental collection, 481 // If a generation bails out of an incremental collection,
473 // it sets this flag. 482 // it sets this flag.
474 bool incremental_collection_will_fail() { 483 bool incremental_collection_failed() const {
475 return _incremental_collection_will_fail; 484 return _incremental_collection_failed;
476 } 485 }
477 void set_incremental_collection_will_fail() { 486 void set_incremental_collection_failed() {
478 _incremental_collection_will_fail = true; 487 _incremental_collection_failed = true;
479 } 488 }
480 void clear_incremental_collection_will_fail() { 489 void clear_incremental_collection_failed() {
481 _incremental_collection_will_fail = false; 490 _incremental_collection_failed = false;
482 }
483
484 bool last_incremental_collection_failed() const {
485 return _last_incremental_collection_failed;
486 }
487 void set_last_incremental_collection_failed() {
488 _last_incremental_collection_failed = true;
489 }
490 void clear_last_incremental_collection_failed() {
491 _last_incremental_collection_failed = false;
492 } 491 }
493 492
494 // Promotion of obj into gen failed. Try to promote obj to higher non-perm 493 // Promotion of obj into gen failed. Try to promote obj to higher non-perm
495 // gens in ascending order; return the new location of obj if successful. 494 // gens in ascending order; return the new location of obj if successful.
496 // Otherwise, try expand-and-allocate for obj in each generation starting at 495 // Otherwise, try expand-and-allocate for obj in each generation starting at