Skip to content

fix: prevent OOM in analyze by adding cycle detection and caching#174

Merged
43081j merged 3 commits intoe18e:mainfrom
dreyfus92:prevent-oom
Feb 21, 2026
Merged

fix: prevent OOM in analyze by adding cycle detection and caching#174
43081j merged 3 commits intoe18e:mainfrom
dreyfus92:prevent-oom

Conversation

@dreyfus92
Copy link
Collaborator

@dreyfus92 dreyfus92 commented Feb 20, 2026

the analyze command could hang and exhaust RAM because dependency traversal had no cycle detection, so circular deps (e.g. A → B → A) caused infinite recursion. this PR adds a visited set to avoid re-entering the same package, uses a map package lookups, caches getPackageJson reads, and unifies the two node_modules crawls into one.

closes: #173

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 20, 2026

Open in StackBlitz

npm i https://pkg.pr.new/e18e/cli/@e18e/cli@174

commit: 4e6db65

@dreyfus92 dreyfus92 changed the title fix: prevent OOM in analyze by adding cycle detection and caching fix: prevent OOM in analyze by adding cycle detection and caching Feb 20, 2026
@hazre
Copy link

hazre commented Feb 20, 2026

I tried it locally and it seems to work!

@43081j 43081j merged commit e0c2d85 into e18e:main Feb 21, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Analyze stuck on "Analyzing…" while increasing memory usage (Windows)

3 participants