From 73456818dbaed095a4c2f740fa767c5a782e9228 Mon Sep 17 00:00:00 2001 From: c30058867 Date: Wed, 23 Jul 2025 21:04:38 +0800 Subject: [PATCH] Tigger gc Issue:https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICODTR Signed-off-by: caiy --- ets2panda/linter/src/lib/LinterRunner.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ets2panda/linter/src/lib/LinterRunner.ts b/ets2panda/linter/src/lib/LinterRunner.ts index 3696ab6898..eca6c7eac1 100644 --- a/ets2panda/linter/src/lib/LinterRunner.ts +++ b/ets2panda/linter/src/lib/LinterRunner.ts @@ -238,6 +238,7 @@ function migrate( const updatedSourceTexts: Map = new Map(); let lintResult: LintRunResult = initialLintResult; const problemsInfosBeforeMigrate = lintResult.problemsInfos; + tiggerGc(); const migrationMaxPass = cmdOptions.linterOptions.migrationMaxPass ?? qEd.DEFAULT_MAX_AUTOFIX_PASSES; for (let pass = 0; pass < migrationMaxPass; pass++) { @@ -252,6 +253,7 @@ function migrate( // Re-compile and re-lint project after applying the fixes. linterConfig = compileLintOptions(cmdOptions, getMigrationCreateProgramCallback(updatedSourceTexts)); lintResult = lintImpl(linterConfig, { currentPass: pass, maxPasses: migrationMaxPass }); + tiggerGc(); } // Write new text for updated source files. @@ -267,6 +269,12 @@ function migrate( return lintResult; } +function tiggerGc(): void { + if (global && global.gc && typeof global.gc === 'function') { + global.gc(); + } +} + function filterLinterProblemsWithAutofixConfig( cmdOptions: CommandLineOptions, problemsInfos: Map -- Gitee