Add fallback for non moving space being full.
When the non moving space becomes full, we disable moving GC and
make the main space the new non moving space.
Also added a runtime option for changing the non moving space size:
-XX:NonMovingSpaceCapacity.
Bug: 17189964
(cherry picked from commit 4c5a469683e433f126c9863cd393747d2e7c4a29)
Change-Id: If82e3c6f8a0f389e37e14a0b1e6d5126d571fd7a
diff --git a/runtime/gc/space/malloc_space.h b/runtime/gc/space/malloc_space.h
index a52b92b..bace3f6 100644
--- a/runtime/gc/space/malloc_space.h
+++ b/runtime/gc/space/malloc_space.h
@@ -133,6 +133,10 @@
return can_move_objects_;
}
+ void DisableMovingObjects() {
+ can_move_objects_ = false;
+ }
+
protected:
MallocSpace(const std::string& name, MemMap* mem_map, byte* begin, byte* end,
byte* limit, size_t growth_limit, bool create_bitmaps, bool can_move_objects,
@@ -175,7 +179,7 @@
size_t growth_limit_;
// True if objects in the space are movable.
- const bool can_move_objects_;
+ bool can_move_objects_;
// Starting and initial sized, used when you reset the space.
const size_t starting_size_;