You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found that this occurs even with a much smaller number of files, particularly if a large set of them happen to change all at once (e.g. ~180 or so in my case, all of them .css and .map files in only like 4 subdirectories, including the root one). That said, I found that removing the nested css/**/*.css glob pattern alleviates the issue. Give that a shot.
You can test this by checking memory usage live as it's running. I do this by running the script in debug mode via:
NODE_OPTIONS='--inspect' node test.js
Then open Chrome DevTools, click the Node.js logo that comes up and then open the "Memory" tab. There you'll see this below. For me, it always starts out at 5MB. However, with the nested subdirectory glob pattern **/ it will bloat until the VM runs out of memory (>2GB). But if I just explicitly watch *.css in each of the 4 explicit directories, it bloats to maybe 150MB at most, hovers around 70MB but eventually falls back to like 5MB.
Edit:#1271 does a fantastic breakdown and I think that's actually what is happening here.
Describe the bug
JavaScript heap out of memory
Versions:
To Reproduce:
I create 250000 files in FILE_DIR and get the memory leak, this code just log the messages
And the memory growth over time when create more files
The text was updated successfully, but these errors were encountered: