File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,9 @@ var sys: System = (function () {
234
234
return ( < any > process ) . cwd ( ) ;
235
235
} ,
236
236
getMemoryUsage ( ) {
237
- global . gc ( ) ;
237
+ if ( global . gc ) {
238
+ global . gc ( ) ;
239
+ }
238
240
return process . memoryUsage ( ) . heapUsed ;
239
241
} ,
240
242
exit ( exitCode ?: number ) : void {
Original file line number Diff line number Diff line change @@ -337,12 +337,16 @@ module ts {
337
337
338
338
reportDiagnostics ( errors ) ;
339
339
if ( commandLine . options . diagnostics ) {
340
+ var memoryUsed = sys . getMemoryUsage ( ) ;
340
341
reportCountStatistic ( "Files" , program . getSourceFiles ( ) . length ) ;
341
342
reportCountStatistic ( "Lines" , countLines ( program ) ) ;
342
343
reportCountStatistic ( "Nodes" , checker ? checker . getNodeCount ( ) : 0 ) ;
343
344
reportCountStatistic ( "Identifiers" , checker ? checker . getIdentifierCount ( ) : 0 ) ;
344
345
reportCountStatistic ( "Symbols" , checker ? checker . getSymbolCount ( ) : 0 ) ;
345
346
reportCountStatistic ( "Types" , checker ? checker . getTypeCount ( ) : 0 ) ;
347
+ if ( memoryUsed ) {
348
+ reportStatisticalValue ( "Memory used" , Math . round ( memoryUsed / 1000 ) + "K" ) ;
349
+ }
346
350
reportTimeStatistic ( "Parse time" , bindStart - parseStart ) ;
347
351
reportTimeStatistic ( "Bind time" , checkStart - bindStart ) ;
348
352
reportTimeStatistic ( "Check time" , emitStart - checkStart ) ;
You can’t perform that action at this time.
0 commit comments