jprichardson / node-fs-extra

Node.js: extra methods for the fs object like copy(), remove(), mkdirs()
MIT License
9.43k stars 775 forks source link

Heads up: fs.createWriteStream will cause a memory leak #1042

Open krystianfowler opened 3 months ago

krystianfowler commented 3 months ago

I have encountered a memory leak that happens when calling fs.createWriteStream from node-fs-extra. Since fs-extra calls gracefu-fs directly for this method I have reported the issue here on the graceful-fs repo: https://github.com/isaacs/node-graceful-fs/issues/248

Since the leak is in graceful-fs I'm adding an issue here mainly as a heads up to anyone looking for a possible cause of their production memory leaks.

The issue is easily solvable by replacing fs-extra calls to createWriteStream with the native node one from node:fs.