1.1 --- a/src/share/vm/memory/generation.hpp Thu Oct 21 17:29:24 2010 -0700 1.2 +++ b/src/share/vm/memory/generation.hpp Sat Oct 23 23:03:49 2010 -0700 1.3 @@ -173,15 +173,11 @@ 1.4 // The largest number of contiguous free bytes in this or any higher generation. 1.5 virtual size_t max_contiguous_available() const; 1.6 1.7 - // Returns true if promotions of the specified amount can 1.8 - // be attempted safely (without a vm failure). 1.9 + // Returns true if promotions of the specified amount are 1.10 + // likely to succeed without a promotion failure. 1.11 // Promotion of the full amount is not guaranteed but 1.12 - // can be attempted. 1.13 - // younger_handles_promotion_failure 1.14 - // is true if the younger generation handles a promotion 1.15 - // failure. 1.16 - virtual bool promotion_attempt_is_safe(size_t promotion_in_bytes, 1.17 - bool younger_handles_promotion_failure) const; 1.18 + // might be attempted in the worst case. 1.19 + virtual bool promotion_attempt_is_safe(size_t max_promotion_in_bytes) const; 1.20 1.21 // For a non-young generation, this interface can be used to inform a 1.22 // generation that a promotion attempt into that generation failed. 1.23 @@ -358,6 +354,16 @@ 1.24 return (full || should_allocate(word_size, is_tlab)); 1.25 } 1.26 1.27 + // Returns true if the collection is likely to be safely 1.28 + // completed. Even if this method returns true, a collection 1.29 + // may not be guaranteed to succeed, and the system should be 1.30 + // able to safely unwind and recover from that failure, albeit 1.31 + // at some additional cost. 1.32 + virtual bool collection_attempt_is_safe() { 1.33 + guarantee(false, "Are you sure you want to call this method?"); 1.34 + return true; 1.35 + } 1.36 + 1.37 // Perform a garbage collection. 1.38 // If full is true attempt a full garbage collection of this generation. 1.39 // Otherwise, attempting to (at least) free enough space to support an