Skip to content

Comments

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

Open
dreyfus92 wants to merge 1 commit intoe18e:mainfrom
dreyfus92:prevent-oom
Open

fix: prevent OOM in analyze by adding cycle detection and caching#174
dreyfus92 wants to merge 1 commit 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: 6e39d36

@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!

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)

2 participants