Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(571)

Side by Side Diff: runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart

Issue 3008593002: Add external sizes to the heap dominator tree. (Closed)
Patch Set: review Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/observatory/lib/object_graph.dart ('k') | runtime/vm/object_graph.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of heap_snapshot; 5 part of heap_snapshot;
6 6
7 class HeapSnapshot implements M.HeapSnapshot { 7 class HeapSnapshot implements M.HeapSnapshot {
8 ObjectGraph graph; 8 ObjectGraph graph;
9 DateTime timestamp; 9 DateTime timestamp;
10 int get objects => graph.vertexCount; 10 int get objects => graph.vertexCount;
11 int get references => graph.edgeCount; 11 int get references => graph.edgeCount;
12 int get size => graph.size; 12 int get size => graph.internalSize + graph.externalSize;
13 HeapSnapshotDominatorNode dominatorTree; 13 HeapSnapshotDominatorNode dominatorTree;
14 HeapSnapshotMergedDominatorNode mergedDominatorTree; 14 HeapSnapshotMergedDominatorNode mergedDominatorTree;
15 List<MergedVertex> classReferences; 15 List<MergedVertex> classReferences;
16 16
17 static Future sleep([Duration duration = const Duration(microseconds: 0)]) { 17 static Future sleep([Duration duration = const Duration(microseconds: 0)]) {
18 final Completer completer = new Completer(); 18 final Completer completer = new Completer();
19 new Timer(duration, () => completer.complete()); 19 new Timer(duration, () => completer.complete());
20 return completer.future; 20 return completer.future;
21 } 21 }
22 22
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 } else { 143 } else {
144 return _children = 144 return _children =
145 new List.unmodifiable(v.dominatorTreeChildren().map((v) { 145 new List.unmodifiable(v.dominatorTreeChildren().map((v) {
146 return new HeapSnapshotDominatorNode(isolate, v); 146 return new HeapSnapshotDominatorNode(isolate, v);
147 })); 147 }));
148 } 148 }
149 } 149 }
150 150
151 int get retainedSize => v.retainedSize; 151 int get retainedSize => v.retainedSize;
152 int get shallowSize => v.shallowSize; 152 int get shallowSize => v.shallowSize;
153 int get externalSize => v.externalSize;
153 154
154 HeapSnapshotDominatorNode(S.Isolate isolate, ObjectVertex vertex) 155 HeapSnapshotDominatorNode(S.Isolate isolate, ObjectVertex vertex)
155 : isolate = isolate, 156 : isolate = isolate,
156 v = vertex; 157 v = vertex;
157 } 158 }
158 159
159 class HeapSnapshotMergedDominatorNode 160 class HeapSnapshotMergedDominatorNode
160 implements M.HeapSnapshotMergedDominatorNode { 161 implements M.HeapSnapshotMergedDominatorNode {
161 final MergedObjectVertex v; 162 final MergedObjectVertex v;
162 final S.Isolate isolate; 163 final S.Isolate isolate;
(...skipping 12 matching lines...) Expand all
175 return _children = 176 return _children =
176 new List.unmodifiable(v.dominatorTreeChildren().map((v) { 177 new List.unmodifiable(v.dominatorTreeChildren().map((v) {
177 return new HeapSnapshotMergedDominatorNode(isolate, v); 178 return new HeapSnapshotMergedDominatorNode(isolate, v);
178 })); 179 }));
179 } 180 }
180 } 181 }
181 182
182 int get instanceCount => v.instanceCount; 183 int get instanceCount => v.instanceCount;
183 int get retainedSize => v.retainedSize; 184 int get retainedSize => v.retainedSize;
184 int get shallowSize => v.shallowSize; 185 int get shallowSize => v.shallowSize;
186 int get externalSize => v.externalSize;
185 187
186 HeapSnapshotMergedDominatorNode(S.Isolate isolate, MergedObjectVertex vertex) 188 HeapSnapshotMergedDominatorNode(S.Isolate isolate, MergedObjectVertex vertex)
187 : isolate = isolate, 189 : isolate = isolate,
188 v = vertex; 190 v = vertex;
189 } 191 }
190 192
191 class MergedEdge { 193 class MergedEdge {
192 final MergedVertex sourceVertex; 194 final MergedVertex sourceVertex;
193 final MergedVertex targetVertex; 195 final MergedVertex targetVertex;
194 int count = 0; 196 int count = 0;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 final MergedEdge edge; 260 final MergedEdge edge;
259 S.Class get target => edge.sourceVertex != vertex 261 S.Class get target => edge.sourceVertex != vertex
260 ? edge.sourceVertex.clazz 262 ? edge.sourceVertex.clazz
261 : edge.targetVertex.clazz; 263 : edge.targetVertex.clazz;
262 int get count => edge.count; 264 int get count => edge.count;
263 int get shallowSize => edge.shallowSize; 265 int get shallowSize => edge.shallowSize;
264 int get retainedSize => edge.retainedSize; 266 int get retainedSize => edge.retainedSize;
265 267
266 HeapSnapshotClassOutbound(this.vertex, this.edge); 268 HeapSnapshotClassOutbound(this.vertex, this.edge);
267 } 269 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/object_graph.dart ('k') | runtime/vm/object_graph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698