comparison src/share/vm/memory/generation.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 126ea7725993
children f95d63e2154a
comparison
equal deleted inserted replaced
1887:cd3ef3fd20dd 1888:a7214d79fcf1
171 // including expansion (Assumes called at a safepoint.) 171 // including expansion (Assumes called at a safepoint.)
172 virtual size_t contiguous_available() const = 0; 172 virtual size_t contiguous_available() const = 0;
173 // The largest number of contiguous free bytes in this or any higher generation. 173 // The largest number of contiguous free bytes in this or any higher generation.
174 virtual size_t max_contiguous_available() const; 174 virtual size_t max_contiguous_available() const;
175 175
176 // Returns true if promotions of the specified amount can 176 // Returns true if promotions of the specified amount are
177 // be attempted safely (without a vm failure). 177 // likely to succeed without a promotion failure.
178 // Promotion of the full amount is not guaranteed but 178 // Promotion of the full amount is not guaranteed but
179 // can be attempted. 179 // might be attempted in the worst case.
180 // younger_handles_promotion_failure 180 virtual bool promotion_attempt_is_safe(size_t max_promotion_in_bytes) const;
181 // is true if the younger generation handles a promotion
182 // failure.
183 virtual bool promotion_attempt_is_safe(size_t promotion_in_bytes,
184 bool younger_handles_promotion_failure) const;
185 181
186 // For a non-young generation, this interface can be used to inform a 182 // For a non-young generation, this interface can be used to inform a
187 // generation that a promotion attempt into that generation failed. 183 // generation that a promotion attempt into that generation failed.
188 // Typically used to enable diagnostic output for post-mortem analysis, 184 // Typically used to enable diagnostic output for post-mortem analysis,
189 // but other uses of the interface are not ruled out. 185 // but other uses of the interface are not ruled out.
356 size_t word_size, 352 size_t word_size,
357 bool is_tlab) { 353 bool is_tlab) {
358 return (full || should_allocate(word_size, is_tlab)); 354 return (full || should_allocate(word_size, is_tlab));
359 } 355 }
360 356
357 // Returns true if the collection is likely to be safely
358 // completed. Even if this method returns true, a collection
359 // may not be guaranteed to succeed, and the system should be
360 // able to safely unwind and recover from that failure, albeit
361 // at some additional cost.
362 virtual bool collection_attempt_is_safe() {
363 guarantee(false, "Are you sure you want to call this method?");
364 return true;
365 }
366
361 // Perform a garbage collection. 367 // Perform a garbage collection.
362 // If full is true attempt a full garbage collection of this generation. 368 // If full is true attempt a full garbage collection of this generation.
363 // Otherwise, attempting to (at least) free enough space to support an 369 // Otherwise, attempting to (at least) free enough space to support an
364 // allocation of the given "word_size". 370 // allocation of the given "word_size".
365 virtual void collect(bool full, 371 virtual void collect(bool full,