mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-17 12:19:32 -05:00
Force a gc before printing diagnostics
Use this together with `node --expose-gc` to get more stable results
This commit is contained in:
@@ -322,6 +322,10 @@ namespace ts {
|
||||
const compilerOptions = program.getCompilerOptions();
|
||||
if (compilerOptions.diagnostics || compilerOptions.extendedDiagnostics) {
|
||||
statistics = [];
|
||||
|
||||
// @ts-ignore
|
||||
if (typeof gc === "function") { gc(); }
|
||||
|
||||
const memoryUsed = sys.getMemoryUsage ? sys.getMemoryUsage() : -1;
|
||||
reportCountStatistic("Files", program.getSourceFiles().length);
|
||||
reportCountStatistic("Lines", countLines(program));
|
||||
|
||||
Reference in New Issue
Block a user