| Index: runtime/vm/scavenger.cc
|
| diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
|
| index c6a3e3e7aa566f3c6b7a03cefd48368abf797b86..e40c5a6ddfaaf54dee25aae10c048d558babe7fc 100644
|
| --- a/runtime/vm/scavenger.cc
|
| +++ b/runtime/vm/scavenger.cc
|
| @@ -844,7 +844,7 @@ void Scavenger::PrintToJSONObject(JSONObject* object) {
|
| space.AddProperty("name", "Scavenger");
|
| space.AddProperty("user_name", "new");
|
| space.AddProperty("collections", collections());
|
| - {
|
| + if (collections() > 0) {
|
| int64_t run_time = OS::GetCurrentTimeMicros() - isolate->start_time();
|
| run_time = Utils::Maximum(run_time, static_cast<int64_t>(0));
|
| double run_time_millis = MicrosecondsToMilliseconds(run_time);
|
| @@ -852,6 +852,8 @@ void Scavenger::PrintToJSONObject(JSONObject* object) {
|
| run_time_millis / static_cast<double>(collections());
|
| space.AddProperty("avgCollectionPeriodMillis",
|
| avg_time_between_collections);
|
| + } else {
|
| + space.AddProperty("avgCollectionPeriodMillis", 0.0);
|
| }
|
| space.AddProperty("used", UsedInWords() * kWordSize);
|
| space.AddProperty("capacity", CapacityInWords() * kWordSize);
|
|
|