Check and log a to-space overflow explicitly.
Measured no noticeable performance regression with Ritzperf
EvaluateAndApplyChanges and -Xgc:SS on Mako.
Change-Id: Ib5ab934b867f91789a82ae771b45c95e9d01390c
diff --git a/runtime/gc/collector/semi_space.cc b/runtime/gc/collector/semi_space.cc
index 95a2c96..d4e26ab 100644
--- a/runtime/gc/collector/semi_space.cc
+++ b/runtime/gc/collector/semi_space.cc
@@ -590,6 +590,7 @@
// If it's allocated after the last GC (younger), copy it to the to-space.
forward_address = to_space_->AllocThreadUnsafe(self_, object_size, &bytes_allocated, nullptr);
}
+ CHECK(forward_address != nullptr) << "Out of memory in the to-space.";
++objects_moved_;
bytes_moved_ += bytes_allocated;
// Copy over the object and add it to the mark stack since we still need to update its