Fix dumpsys meminfo <pid>.
Added a case for BumpPointerSpaces. Confirmed working non-debug.
Should also work in debug builds.
Bug: 11830794
Change-Id: I12053ff16eec403dcd4a780e13095e3212a77132
diff --git a/runtime/gc/collector_type.h b/runtime/gc/collector_type.h
index a42819b..ba3cad6 100644
--- a/runtime/gc/collector_type.h
+++ b/runtime/gc/collector_type.h
@@ -24,8 +24,11 @@
// Which types of collections are able to be performed.
enum CollectorType {
+ // Non concurrent mark-sweep.
kCollectorTypeMS,
+ // Concurrent mark-sweep.
kCollectorTypeCMS,
+ // Semi-space / mark-sweep hybrid, enables compaction.
kCollectorTypeSS,
};
std::ostream& operator<<(std::ostream& os, const CollectorType& collector_type);
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index d8902f0..5e62729 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -72,7 +72,6 @@
static constexpr size_t kGcAlotInterval = KB;
// Minimum amount of remaining bytes before a concurrent GC is triggered.
static constexpr size_t kMinConcurrentRemainingBytes = 128 * KB;
-static constexpr AllocatorType kDefaultPreZygoteAllocator = kAllocatorTypeFreeList;
Heap::Heap(size_t initial_size, size_t growth_limit, size_t min_free, size_t max_free,
double target_utilization, size_t capacity, const std::string& image_file_name,
@@ -1215,6 +1214,8 @@
case kCollectorTypeCMS: {
ChangeAllocator(kAllocatorTypeFreeList);
break;
+ default:
+ LOG(FATAL) << "Unimplemented";
}
}
}
diff --git a/runtime/gc/space/bump_pointer_space.h b/runtime/gc/space/bump_pointer_space.h
index 9b0b6aa..2edd3e2 100644
--- a/runtime/gc/space/bump_pointer_space.h
+++ b/runtime/gc/space/bump_pointer_space.h
@@ -120,7 +120,11 @@
static mirror::Object* GetNextObject(mirror::Object* obj)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- // Alignment.
+ virtual BumpPointerSpace* AsBumpPointerSpace() {
+ return this;
+ }
+
+ // Object alignment within the space.
static constexpr size_t kAlignment = 8;
protected:
diff --git a/runtime/gc/space/space.h b/runtime/gc/space/space.h
index 38b602e..ca39175 100644
--- a/runtime/gc/space/space.h
+++ b/runtime/gc/space/space.h
@@ -43,6 +43,7 @@
namespace space {
class AllocSpace;
+class BumpPointerSpace;
class ContinuousSpace;
class DiscontinuousSpace;
class MallocSpace;
@@ -138,6 +139,10 @@
bool IsBumpPointerSpace() const {
return GetType() == kSpaceTypeBumpPointerSpace;
}
+ virtual BumpPointerSpace* AsBumpPointerSpace() {
+ LOG(FATAL) << "Unreachable";
+ return NULL;
+ }
// Does this space hold large objects and implement the large object space abstraction?
bool IsLargeObjectSpace() const {