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

Unified Diff: runtime/observatory/lib/src/elements/heap_map.dart

Issue 2953373002: [observatory] Add a 'GC' button to heap map. (Closed)
Patch Set: Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/observatory/lib/src/repositories/allocation_profile.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/elements/heap_map.dart
diff --git a/runtime/observatory/lib/src/elements/heap_map.dart b/runtime/observatory/lib/src/elements/heap_map.dart
index 0abd092241eb06c186835d4f9e0304557e75c28f..41e1e989d92780717bab112930090d037546a7cb 100644
--- a/runtime/observatory/lib/src/elements/heap_map.dart
+++ b/runtime/observatory/lib/src/elements/heap_map.dart
@@ -108,6 +108,8 @@ class HeapMapElement extends HtmlElement implements Renderable {
new NavVMMenuElement(_vm, _events, queue: _r.queue),
new NavIsolateMenuElement(_isolate, _events, queue: _r.queue),
navMenu('heap map'),
+ new NavRefreshElement(label: 'GC', queue: _r.queue)
+ ..onRefresh.listen((_) => _refresh(gc: true)),
new NavRefreshElement(queue: _r.queue)
..onRefresh.listen((_) => _refresh()),
new NavNotifyElement(_notifications, queue: _r.queue)
@@ -277,9 +279,15 @@ class HeapMapElement extends HtmlElement implements Renderable {
});
}
- Future _refresh() {
+ Future _refresh({gc: false}) {
final isolate = _isolate as S.Isolate;
- return isolate.invokeRpc('_getHeapMap', {}).then((S.ServiceMap response) {
+ var params = {};
+ if (gc) {
+ params['gc'] = 'full';
+ }
+ return isolate
+ .invokeRpc('_getHeapMap', params)
+ .then((S.ServiceMap response) {
assert(response['type'] == 'HeapMap');
_fragmentation = response;
_updateFragmentationData();
« no previous file with comments | « no previous file | runtime/observatory/lib/src/repositories/allocation_profile.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698