I'm getting Error: EMFILE, too many open files on calling
I see there was an issue that was fixed in v0.6.14, however I'm on v0.8.8
and still seeing it.
There is a test for the bug in test/simple/test-memory-usage-emfile.js
which opens up 255 files and then tries to call process.memoryUsage() which
seems to pass. However, when I bump the number of files to say 1024 it
fails. Excerpt from the test:
while (files.length < 256)
> files.push(fs.openSync(__filename, 'r')); I was wondering what the significance of the 256 is? Unless I'm missing
> var r = process.memoryUsage();
something, or doing something wrong, it seems like there might still be an
Side note, winston (logging library) uses this call when trying to handle
exceptions, causing it to fail and node to exit. So I'd be careful if
you're relying on that feature of the library.