dylang / npm-check

Check for outdated, incorrect, and unused dependencies.
https://www.npmjs.com/package/npm-check
MIT License
6.58k stars 239 forks source link

unused check consumes huge amount of memory #412

Open honeo opened 2 years ago

honeo commented 2 years ago

v5.9.2 Node.js v16.10.0 Win10Pro21H1 or Ubuntu 20.04

I was tired of continually increasing virtual memory to counter OOM-Killer, so I did some research on my own.

When options.skipUnused=false, it seems to store all files under the directory you set as options.cwd in memory. For example, let's say you have a 1GB directory called database in your target directory, in addition to package.json, index.mjs, and node_modules. If you run npm-check in this state, the memory usage will easily exceed 7GB.

SDAdham commented 2 years ago

same here on linux, unusable!