GC data structures allocation tracking
Adds a new stl compatible allocator that is used in most GC data
structures. When the data structures allocate and free memory, it
lets the heap know of how much memory was allocated or freed. Using
this info, we dump the approximated stl data structures memory usage
when a sigquit occurs.
The allocation tracking can be disabled with a compile time boolean
flag to remove performance impact.
Change-Id: Idddb6713169e07be913bceeb50f305c8573e4392
diff --git a/runtime/gc/space/large_object_space.h b/runtime/gc/space/large_object_space.h
index 09c55ec..8cd5088 100644
--- a/runtime/gc/space/large_object_space.h
+++ b/runtime/gc/space/large_object_space.h
@@ -17,7 +17,7 @@
#ifndef ART_RUNTIME_GC_SPACE_LARGE_OBJECT_SPACE_H_
#define ART_RUNTIME_GC_SPACE_LARGE_OBJECT_SPACE_H_
-
+#include "gc/accounting/gc_allocator.h"
#include "dlmalloc_space.h"
#include "safe_map.h"
#include "space.h"
@@ -95,8 +95,10 @@
// Used to ensure mutual exclusion when the allocation spaces data structures are being modified.
mutable Mutex lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
- std::vector<mirror::Object*> large_objects_ GUARDED_BY(lock_);
- typedef SafeMap<mirror::Object*, MemMap*> MemMaps;
+ std::vector<mirror::Object*,
+ accounting::GCAllocator<mirror::Object*> > large_objects_ GUARDED_BY(lock_);
+ typedef SafeMap<mirror::Object*, MemMap*, std::less<mirror::Object*>,
+ accounting::GCAllocator<std::pair<const mirror::Object*, MemMap*> > > MemMaps;
MemMaps mem_maps_ GUARDED_BY(lock_);
};