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

Side by Side Diff: pkg/compiler/tool/track_memory.dart

Issue 2944843002: All strong mode cleaning of dart2js. (Closed)
Patch Set: More issues discovered during testing. 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/tool/dart2js_profile_many.dart ('k') | pkg/testing/lib/src/analyze.dart » ('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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 /// A script to track the high water-mark of memory usage of an application. 5 /// A script to track the high water-mark of memory usage of an application.
6 /// To monitor how much memory dart2js is using, run dart2js as follows: 6 /// To monitor how much memory dart2js is using, run dart2js as follows:
7 /// 7 ///
8 /// DART_VM_OPTIONS=--observe dart2js ... 8 /// DART_VM_OPTIONS=--observe dart2js ...
9 /// 9 ///
10 /// and run this script immediately after. 10 /// and run this script immediately after.
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 sb.write(' | '); 144 sb.write(' | ');
145 _writeNumber(sb, lastOldUsed, oldUsed); 145 _writeNumber(sb, lastOldUsed, oldUsed);
146 _writeNumber(sb, lastOldCapacity, oldCapacity, color: true); 146 _writeNumber(sb, lastOldCapacity, oldCapacity, color: true);
147 147
148 sb.write(' | '); 148 sb.write(' | ');
149 _writeNumber(sb, lastNewUsed + lastOldUsed, newUsed + oldUsed); 149 _writeNumber(sb, lastNewUsed + lastOldUsed, newUsed + oldUsed);
150 _writeNumber(sb, lastNewCapacity + lastOldCapacity, newCapacity + oldCapacity, 150 _writeNumber(sb, lastNewCapacity + lastOldCapacity, newCapacity + oldCapacity,
151 color: true); 151 color: true);
152 152
153 sb.write(' | '); 153 sb.write(' | ');
154 var maxUsed = max(lastMaxUsed, newUsed + oldUsed); 154 int maxUsed = max(lastMaxUsed, newUsed + oldUsed);
155 var maxCapacity = max(lastMaxCapacity, newCapacity + oldCapacity); 155 int maxCapacity = max(lastMaxCapacity, newCapacity + oldCapacity);
156 _writeNumber(sb, lastMaxUsed, maxUsed); 156 _writeNumber(sb, lastMaxUsed, maxUsed);
157 _writeNumber(sb, lastMaxCapacity, maxCapacity, color: true); 157 _writeNumber(sb, lastMaxCapacity, maxCapacity, color: true);
158 stdout.write('$sb'); 158 stdout.write('$sb');
159 159
160 lastNewUsed = newUsed; 160 lastNewUsed = newUsed;
161 lastOldUsed = oldUsed; 161 lastOldUsed = oldUsed;
162 lastMaxUsed = maxUsed; 162 lastMaxUsed = maxUsed;
163 lastNewCapacity = newCapacity; 163 lastNewCapacity = newCapacity;
164 lastOldCapacity = oldCapacity; 164 lastOldCapacity = oldCapacity;
165 lastMaxCapacity = maxCapacity; 165 lastMaxCapacity = maxCapacity;
(...skipping 19 matching lines...) Expand all
185 _printHeader() { 185 _printHeader() {
186 print(''' 186 print('''
187 Memory usage: 187 Memory usage:
188 new generation | old generation | total | max 188 new generation | old generation | total | max
189 in-use/capacity | in-use/capacity | in-use/capacity | in-use/capacity '''); 189 in-use/capacity | in-use/capacity | in-use/capacity | in-use/capacity ''');
190 } 190 }
191 191
192 const _RED = '\x1b[31m'; 192 const _RED = '\x1b[31m';
193 const _GREEN = '\x1b[32m'; 193 const _GREEN = '\x1b[32m';
194 const _NONE = '\x1b[0m'; 194 const _NONE = '\x1b[0m';
OLDNEW
« no previous file with comments | « pkg/compiler/tool/dart2js_profile_many.dart ('k') | pkg/testing/lib/src/analyze.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698