GNU bug report logs - #22814
25.0.91; Emacs runs out of file descriptors on OS X

Previous Next

Package: emacs;

Reported by: David Caldwell <david <at> porkrind.org>

Date: Fri, 26 Feb 2016 06:19:02 UTC

Severity: normal

Found in version 25.0.91

Fixed in version 26.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: David Caldwell <david <at> porkrind.org>
To: 22814 <at> debbugs.gnu.org
Subject: bug#22814: 25.0.91; Emacs runs out of file descriptors on OS X
Date: Fri, 26 Feb 2016 01:05:56 -0800
[Message part 1 (text/plain, inline)]
On 2/26/16 12:34 AM, Michael Albinus wrote:
> David Caldwell <david <at> porkrind.org> writes:
>> I have a large emacs desktop file (600+ buffers at the moment). Emacs
>> 24.5 would open all the buffers just fine, but 25.0.91 (and 90)
>> apparently don't close the file after reading the buffer (or maybe it's
>> part of the new kqueue stuff?). By default OS X limits the number of
>> file descriptors per process to 256. So trying to open my large desktop
>> file gets it into a stuck state where it cannot open any more files
>> after it loads the first 240ish buffers.
>
> You are using "global-auto-revert-mode: t". kqueue does not support a
> directory monitor, therefore it starts a new file notification monitor
> for every single file, indeed.

Ah, I see. Maybe the FSEvents API[1] would be better in this case?

> I believe it is questionable to run auto-revert-mode for so many
> files,

> but that's your choice.=20

It's just stat()s, right? Those are really fast, especially on my ssd.
At any rate, I've never noticed any slowdown. I guess I always assumed
it would check only for buffers I was displaying, rather than ones in
the background (because why would I care if a buffer I couldn't see had
stale data in it?).

> In order to suppress kqueue running for auto-revert-mode, you shall 
> set auto-revert-use-notify to nil.

Thanks! That indeed does the trick. I'm back to 24.5 numbers of fds open.

> Maybe there are means in OS X to increase the number of file
> descriptors for Emacs, don't know. I don't use OS X.

`ulimit -u 10000` was my temporary work-around, but I had to remember to
do it every time I booted or emacs would hose itself (I don't think I
ever successfully remembered).

> I will add a note to the Emacs manual.

Thanks.

-David

[smime.p7s (application/pkcs7-signature, attachment)]

This bug report was last modified 8 years and 231 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.