Skip to content

Commit 72c0961

Browse files
committed
Force a gc before printing diagnostics
Use this together with `node --expose-gc` to get more stable results
1 parent a4bacf3 commit 72c0961

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/tsc/tsc.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ namespace ts {
322322
const compilerOptions = program.getCompilerOptions();
323323
if (compilerOptions.diagnostics || compilerOptions.extendedDiagnostics) {
324324
statistics = [];
325+
326+
// @ts-ignore
327+
if (typeof gc === "function") { gc(); }
328+
325329
const memoryUsed = sys.getMemoryUsage ? sys.getMemoryUsage() : -1;
326330
reportCountStatistic("Files", program.getSourceFiles().length);
327331
reportCountStatistic("Lines", countLines(program));

0 commit comments

Comments
 (0)