From 3290f60a31620ceafdc9220d59cd303c4e535646 Mon Sep 17 00:00:00 2001 From: Jens Johansen Date: Mon, 20 Aug 2018 07:03:25 +0000 Subject: [PATCH] Fix 'toplist by retained memory' in observatory Prior to this fix I get errors like ``` TypeError: Instance of 'b2': type 'b2' is not a subtype of type 'List' StackTrace: main.dart.js 1631:3 Object.m main.dart.js 2001:9 Object.p [...] ``` Change-Id: I2fc6329c05cb76bff76929aeee1eca3954fbc0a9 Reviewed-on: https://dart-review.googlesource.com/70501 Reviewed-by: Ryan Macnak Commit-Queue: Jens Johansen --- runtime/observatory/lib/object_graph.dart | 2 +- runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/observatory/lib/object_graph.dart b/runtime/observatory/lib/object_graph.dart index 3ccc6c349b2..044f123830e 100644 --- a/runtime/observatory/lib/object_graph.dart +++ b/runtime/observatory/lib/object_graph.dart @@ -452,7 +452,7 @@ class ObjectGraph { new List.from(vertices.where((u) => !u.isRoot)); _mostRetained.sort((u, v) => v.retainedSize - u.retainedSize); - var result = _mostRetained; + Iterable result = _mostRetained; if (classId != null) { result = result.where((u) => u.vmCid == classId); } diff --git a/runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart b/runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart index 9b90eaa8a03..130d56ce2fc 100644 --- a/runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart +++ b/runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart @@ -116,7 +116,7 @@ class HeapSnapshot implements M.HeapSnapshot { List> getMostRetained(S.Isolate isolate, {int classId, int limit}) { - var result = []; + List> result = >[]; for (ObjectVertex v in graph.getMostRetained(classId: classId, limit: limit)) { result.add(