From 13bf2e6a6c14bccf5377998b7568100ffd417f8e Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Mon, 19 May 2014 12:49:45 -0700 Subject: Check and log a to-space overflow explicitly. Measured no noticeable performance regression with Ritzperf EvaluateAndApplyChanges and -Xgc:SS on Mako. Change-Id: Ib5ab934b867f91789a82ae771b45c95e9d01390c --- runtime/gc/collector/semi_space.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/gc/collector/semi_space.cc b/runtime/gc/collector/semi_space.cc index 95a2c96091..d4e26ab083 100644 --- a/runtime/gc/collector/semi_space.cc +++ b/runtime/gc/collector/semi_space.cc @@ -590,6 +590,7 @@ mirror::Object* SemiSpace::MarkNonForwardedObject(mirror::Object* obj) { // 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 -- cgit v1.2.3