6896603: CMS/GCH: collection_attempt_is_safe() ergo should use more recent data

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
This commit is contained in:
Y. Srinivas Ramakrishna 2010-10-23 23:03:49 -07:00
parent 554e77efb4
commit cbc7f8756a
14 changed files with 101 additions and 222 deletions

View file

@ -173,15 +173,11 @@ class Generation: public CHeapObj {
// The largest number of contiguous free bytes in this or any higher generation.
virtual size_t max_contiguous_available() const;
// Returns true if promotions of the specified amount can
// be attempted safely (without a vm failure).
// Returns true if promotions of the specified amount are
// likely to succeed without a promotion failure.
// Promotion of the full amount is not guaranteed but
// can be attempted.
// younger_handles_promotion_failure
// is true if the younger generation handles a promotion
// failure.
virtual bool promotion_attempt_is_safe(size_t promotion_in_bytes,
bool younger_handles_promotion_failure) const;
// might be attempted in the worst case.
virtual bool promotion_attempt_is_safe(size_t max_promotion_in_bytes) const;
// For a non-young generation, this interface can be used to inform a
// generation that a promotion attempt into that generation failed.
@ -358,6 +354,16 @@ class Generation: public CHeapObj {
return (full || should_allocate(word_size, is_tlab));
}
// Returns true if the collection is likely to be safely
// completed. Even if this method returns true, a collection
// may not be guaranteed to succeed, and the system should be
// able to safely unwind and recover from that failure, albeit
// at some additional cost.
virtual bool collection_attempt_is_safe() {
guarantee(false, "Are you sure you want to call this method?");
return true;
}
// Perform a garbage collection.
// If full is true attempt a full garbage collection of this generation.
// Otherwise, attempting to (at least) free enough space to support an