I'm getting Error: EMFILE, too many open files on calling process.memoryUsage().
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')); > var r = process.memoryUsage();
I was wondering what the significance of the 256 is? Unless I'm missing something, or doing something wrong, it seems like there might still be an issue.
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.
On Thu, Oct 11, 2012 at 3:13 AM, Daniel Friedman <dan...@ninjablocks.com> wrote:
> Hey guys,
> I'm getting Error: EMFILE, too many open files on calling
> process.memoryUsage().
> 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'));
>> var r = process.memoryUsage();
> I was wondering what the significance of the 256 is? Unless I'm missing
> something, or doing something wrong, it seems like there might still be an
> issue.
> 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.
> Dan
You didn't mention your operating system but if it's OS X, you need to
completely log out and log in again for the ulimit change to become
effective.
The number 256 is not significant except in a programmer aesthetic sense.
Sent from my Windows Phone
------------------------------
From: Daniel Friedman
Sent: 11/10/2012 6:17 PM
To: nodejs@googlegroups.com
Subject: [nodejs] EMFILE on process.memoryUsage()
Hey guys,
I'm getting Error: EMFILE, too many open files on calling
process.memoryUsage().
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'));
> var r = process.memoryUsage();
I was wondering what the significance of the 256 is? Unless I'm missing
something, or doing something wrong, it seems like there might still be an
issue.
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.
Seeing it on AWS's Linux Image, ulimit -n is 1024. I get the feeling something must not be cleaning up after itself if there are 1024 open files after a given period of time. I'll bump up the limit in the mean time.
On Friday, October 12, 2012 12:21:41 AM UTC+11, Fadrizul H wrote:
> Increase yer ulimit
> Sent from my Windows Phone > ------------------------------ > From: Daniel Friedman > Sent: 11/10/2012 6:17 PM > To: nod...@googlegroups.com <javascript:> > Subject: [nodejs] EMFILE on process.memoryUsage()
> Hey guys,
> I'm getting Error: EMFILE, too many open files on calling > process.memoryUsage().
> 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')); >> var r = process.memoryUsage();
> I was wondering what the significance of the 256 is? Unless I'm missing > something, or doing something wrong, it seems like there might still be an > issue.
> 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.