src/hotspot/share/gc/g1/g1Policy.cpp
changeset 50441 523c2a73a3dc
parent 49911 358be4680d12
child 51332 c25572739e7c
--- a/src/hotspot/share/gc/g1/g1Policy.cpp	Thu Jun 07 11:20:18 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1Policy.cpp	Thu Jun 07 11:20:30 2018 +0200
@@ -825,10 +825,10 @@
 
 size_t G1Policy::predict_bytes_to_copy(HeapRegion* hr) const {
   size_t bytes_to_copy;
-  if (hr->is_marked())
+  if (!hr->is_young()) {
     bytes_to_copy = hr->max_live_bytes();
-  else {
-    assert(hr->is_young() && hr->age_in_surv_rate_group() != -1, "invariant");
+  } else {
+    assert(hr->age_in_surv_rate_group() != -1, "invariant");
     int age = hr->age_in_surv_rate_group();
     double yg_surv_rate = predict_yg_surv_rate(age, hr->surv_rate_group());
     bytes_to_copy = (size_t) (hr->used() * yg_surv_rate);