Refactor spaces and add free list large object space
Added some more abstraction for spaces, we now have ContinuousSpaces and DiscontinousSpaces.
Added a free list version of large object space.
Performance should be better than the memory map version since we avoid creating more than
one memory map.
Added a cause for Gc which prints with the Gc message, dalvik has this as well.
Change-Id: Ie4aa6b204fbde7193e8305eb246158fae0444cc1
diff --git a/src/native/dalvik_system_VMRuntime.cc b/src/native/dalvik_system_VMRuntime.cc
index f37b237..7184e48 100644
--- a/src/native/dalvik_system_VMRuntime.cc
+++ b/src/native/dalvik_system_VMRuntime.cc
@@ -160,7 +160,7 @@
uint64_t start_ns = NanoTime();
AllocSpace* alloc_space = heap->GetAllocSpace();
size_t alloc_space_size = alloc_space->Size();
- float utilization = static_cast<float>(heap->GetBytesAllocated()) / alloc_space_size;
+ float utilization = static_cast<float>(alloc_space->GetNumBytesAllocated()) / alloc_space_size;
Thread* self = static_cast<JNIEnvExt*>(env)->self;
heap->Trim(self);
// Trim the native heap.