dylang/npm-check

unused check consumes huge amount of memory

honeo opened this issue · 1 comments

honeo commented

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.

same here on linux, unusable!