Skip to content

Commit 3255a75

Browse files
committed
defensive check to clear cache
1 parent e830e6b commit 3255a75

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packages/code-analyzer-core/src/code-analyzer.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,12 @@ export class CodeAnalyzer {
356356
// Reset suppression counter for this run
357357
this.totalSuppressedViolations = 0;
358358

359+
// Clear suppression caches from previous runs to prevent unbounded memory growth
360+
// Each run typically analyzes a different workspace, so caching across runs provides minimal benefit
361+
// while keeping stale data in memory.
362+
this.suppressionsMap.clear();
363+
this.fileProcessingPromises.clear();
364+
359365
this.emitLogEvent(LogLevel.Debug, getMessage('RunningWithWorkspace', JSON.stringify({
360366
filesAndFolders: runOptions.workspace.getRawFilesAndFolders(),
361367
targets: runOptions.workspace.getRawTargets()

0 commit comments

Comments
 (0)