--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp Wed Jan 18 09:50:16 2012 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp Wed Feb 15 13:06:53 2012 -0500
@@ -415,6 +415,16 @@
return used_at_mark_start_bytes - marked_bytes();
}
+ // Return the amount of bytes we'll reclaim if we collect this
+ // region. This includes not only the known garbage bytes in the
+ // region but also any unallocated space in it, i.e., [top, end),
+ // since it will also be reclaimed if we collect the region.
+ size_t reclaimable_bytes() {
+ size_t known_live_bytes = live_bytes();
+ assert(known_live_bytes <= capacity(), "sanity");
+ return capacity() - known_live_bytes;
+ }
+
// An upper bound on the number of live bytes in the region.
size_t max_live_bytes() { return used() - garbage_bytes(); }
@@ -648,10 +658,8 @@
init_top_at_mark_start();
}
- // <PREDICTION>
void calc_gc_efficiency(void);
double gc_efficiency() { return _gc_efficiency;}
- // </PREDICTION>
bool is_young() const { return _young_type != NotYoung; }
bool is_survivor() const { return _young_type == Survivor; }