1.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.hpp Wed Jan 18 09:50:16 2012 -0800 1.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.hpp Wed Feb 15 13:06:53 2012 -0500 1.3 @@ -415,6 +415,16 @@ 1.4 return used_at_mark_start_bytes - marked_bytes(); 1.5 } 1.6 1.7 + // Return the amount of bytes we'll reclaim if we collect this 1.8 + // region. This includes not only the known garbage bytes in the 1.9 + // region but also any unallocated space in it, i.e., [top, end), 1.10 + // since it will also be reclaimed if we collect the region. 1.11 + size_t reclaimable_bytes() { 1.12 + size_t known_live_bytes = live_bytes(); 1.13 + assert(known_live_bytes <= capacity(), "sanity"); 1.14 + return capacity() - known_live_bytes; 1.15 + } 1.16 + 1.17 // An upper bound on the number of live bytes in the region. 1.18 size_t max_live_bytes() { return used() - garbage_bytes(); } 1.19 1.20 @@ -648,10 +658,8 @@ 1.21 init_top_at_mark_start(); 1.22 } 1.23 1.24 - // <PREDICTION> 1.25 void calc_gc_efficiency(void); 1.26 double gc_efficiency() { return _gc_efficiency;} 1.27 - // </PREDICTION> 1.28 1.29 bool is_young() const { return _young_type != NotYoung; } 1.30 bool is_survivor() const { return _young_type == Survivor; }