Added support for -XX:HeapGrowthLimit switch

Runtime can now take in a growth limit for the heap, which can be
smaller than the maximum size of the heap, and will prevent the heap
from growing beyond that size. The growth limit can also be cleared to
increase the size of the heap to the specified maximum size. This gives
apps some control of the size of the heap, but should be removed when we
have better ways to resize the heap.

Change-Id: I338655bccd20bfd32e2318365f0f3283dbaaab1e
diff --git a/src/heap_test.cc b/src/heap_test.cc
index addbc0b..77b98e4 100644
--- a/src/heap_test.cc
+++ b/src/heap_test.cc
@@ -6,6 +6,16 @@
 
 class HeapTest : public CommonTest {};
 
+TEST_F(HeapTest, ClearGrowthLimit) {
+  int64_t max_memory_before = Heap::GetMaxMemory();
+  int64_t total_memory_before = Heap::GetTotalMemory();
+  Heap::ClearGrowthLimit();
+  int64_t max_memory_after = Heap::GetMaxMemory();
+  int64_t total_memory_after = Heap::GetTotalMemory();
+  EXPECT_GE(max_memory_after, max_memory_before);
+  EXPECT_GE(total_memory_after, total_memory_before);
+}
+
 TEST_F(HeapTest, GarbageCollectClassLinkerInit) {
   // garbage is created during ClassLinker::Init