Index: runtime/vm/pages.cc |
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc |
index 06f15b31e3c6951d9f4ea5532f14ce8aa61cced1..d5fc8ecaad7c3744c2865a17bd6db6ff3867083a 100644 |
--- a/runtime/vm/pages.cc |
+++ b/runtime/vm/pages.cc |
@@ -131,7 +131,9 @@ PageSpace::PageSpace(Heap* heap, intptr_t max_capacity_in_words) |
sweeping_(false), |
page_space_controller_(FLAG_heap_growth_space_ratio, |
FLAG_heap_growth_rate, |
- FLAG_heap_growth_time_ratio) { |
+ FLAG_heap_growth_time_ratio), |
+ gc_time_micros_(0), |
+ collections_(0) { |
} |
@@ -391,6 +393,19 @@ void PageSpace::WriteProtect(bool read_only) { |
} |
+void PageSpace::PrintToJSONObject(JSONObject* object) { |
+ JSONObject space(object, "old"); |
+ space.AddProperty("type", "PageSpace"); |
+ space.AddProperty("id", "heaps/old"); |
+ space.AddProperty("name", "PageSpace"); |
+ space.AddProperty("user_name", "old"); |
+ space.AddProperty("collections", collections()); |
+ space.AddProperty("used", UsedInWords() * kWordSize); |
+ space.AddProperty("capacity", CapacityInWords() * kWordSize); |
+ space.AddProperty("time", RoundMicrosecondsToSeconds(gc_time_micros())); |
+} |
+ |
+ |
bool PageSpace::ShouldCollectCode() { |
// Try to collect code if enough time has passed since the last attempt. |
const int64_t start = OS::GetCurrentTimeMicros(); |