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

Side by Side Diff: runtime/observatory/lib/src/service/object.dart

Issue 2656723002: Moved isolate high watermark calculations into the Observatory client. (Closed)
Patch Set: Initialized _memoryHighWatermark in object.dart Created 3 years, 10 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 | « no previous file | runtime/vm/isolate.h » ('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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 service; 5 part of service;
6 6
7 // Some value smaller than the object ring, so requesting a large array 7 // Some value smaller than the object ring, so requesting a large array
8 // doesn't result in an expired ref because the elements lapped it in the 8 // doesn't result in an expired ref because the elements lapped it in the
9 // object ring. 9 // object ring.
10 const int kDefaultFieldLimit = 100; 10 const int kDefaultFieldLimit = 100;
(...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 1501
1502 DartError error; 1502 DartError error;
1503 StreamController _snapshotFetch; 1503 StreamController _snapshotFetch;
1504 1504
1505 List<ByteData> _chunksInProgress; 1505 List<ByteData> _chunksInProgress;
1506 1506
1507 List<Thread> get threads => _threads; 1507 List<Thread> get threads => _threads;
1508 final List<Thread> _threads = new List<Thread>(); 1508 final List<Thread> _threads = new List<Thread>();
1509 1509
1510 int get memoryHighWatermark => _memoryHighWatermark; 1510 int get memoryHighWatermark => _memoryHighWatermark;
1511 int _memoryHighWatermark; 1511 int _memoryHighWatermark = 0;
1512 1512
1513 int get numZoneHandles => _numZoneHandles; 1513 int get numZoneHandles => _numZoneHandles;
1514 int _numZoneHandles; 1514 int _numZoneHandles;
1515 1515
1516 int get numScopedHandles => _numScopedHandles; 1516 int get numScopedHandles => _numScopedHandles;
1517 int _numScopedHandles; 1517 int _numScopedHandles;
1518 1518
1519 void _loadHeapSnapshot(ServiceEvent event) { 1519 void _loadHeapSnapshot(ServiceEvent event) {
1520 if (_snapshotFetch == null || _snapshotFetch.isClosed) { 1520 if (_snapshotFetch == null || _snapshotFetch.isClosed) {
1521 // No outstanding snapshot request. Presumably another client asked for a 1521 // No outstanding snapshot request. Presumably another client asked for a
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1638 extensionRPCs.clear(); 1638 extensionRPCs.clear();
1639 if (map['extensionRPCs'] != null) { 1639 if (map['extensionRPCs'] != null) {
1640 extensionRPCs.addAll(map['extensionRPCs']); 1640 extensionRPCs.addAll(map['extensionRPCs']);
1641 } 1641 }
1642 1642
1643 threads.clear(); 1643 threads.clear();
1644 if(map['_threads'] != null) { 1644 if(map['_threads'] != null) {
1645 threads.addAll(map['_threads']); 1645 threads.addAll(map['_threads']);
1646 } 1646 }
1647 1647
1648 _memoryHighWatermark = int.parse(map['_memoryHighWatermark']); 1648 int currentMemoryHighWatermark = 0;
1649 for (var i = 0; i < threads.length; i++) {
1650 currentMemoryHighWatermark += threads[i].memoryHighWatermark;
1651 }
1649 1652
1650 if (map['threads'] != null) { 1653 if (currentMemoryHighWatermark > _memoryHighWatermark) {
1651 threads.addAll(map['threads']); 1654 _memoryHighWatermark = currentMemoryHighWatermark;
1652 } 1655 }
1653 1656
1654 _numZoneHandles = map['_numZoneHandles']; 1657 _numZoneHandles = map['_numZoneHandles'];
1655 _numScopedHandles = map['_numScopedHandles']; 1658 _numScopedHandles = map['_numScopedHandles'];
1656 } 1659 }
1657 1660
1658 Future<TagProfile> updateTagProfile() { 1661 Future<TagProfile> updateTagProfile() {
1659 return isolate.invokeRpcNoUpgrade('_getTagProfile', {}).then((Map map) { 1662 return isolate.invokeRpcNoUpgrade('_getTagProfile', {}).then((Map map) {
1660 var seconds = new DateTime.now().millisecondsSinceEpoch / 1000.0; 1663 var seconds = new DateTime.now().millisecondsSinceEpoch / 1000.0;
1661 tagProfile._processTagProfile(seconds, map); 1664 tagProfile._processTagProfile(seconds, map);
(...skipping 2852 matching lines...) Expand 10 before | Expand all | Expand 10 after
4514 var v = list[i]; 4517 var v = list[i];
4515 if ((v is Map) && _isServiceMap(v)) { 4518 if ((v is Map) && _isServiceMap(v)) {
4516 list[i] = owner.getFromMap(v); 4519 list[i] = owner.getFromMap(v);
4517 } else if (v is List) { 4520 } else if (v is List) {
4518 _upgradeList(v, owner); 4521 _upgradeList(v, owner);
4519 } else if (v is Map) { 4522 } else if (v is Map) {
4520 _upgradeMap(v, owner); 4523 _upgradeMap(v, owner);
4521 } 4524 }
4522 } 4525 }
4523 } 4526 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698