bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22814: 25.0.91; Emacs runs out of file descriptors on OS X


From: Michael Albinus
Subject: bug#22814: 25.0.91; Emacs runs out of file descriptors on OS X
Date: Sat, 27 Feb 2016 13:17:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Anders Lindgren <address@hidden> writes:

>     Can you debug this?
>
> Not within a reasonable time frame, unfortunately.

I've debugged this on FreeBSD 10. It has larger limits:

--8<---------------cut here---------------start------------->8---
address@hidden:~/src/emacs-25 % ulimit -u
5749
address@hidden:~/src/emacs-25 % ulimit -n
28791
--8<---------------cut here---------------end--------------->8---




1. Run unlimited number of file-notify-add-watch:

--8<---------------cut here---------------start------------->8---
      (let ((temporary-file-directory file-notify--test-tmpfile))
        (while t
          (setq file-notify--test-tmpfile1 (file-notify--test-make-temp-name))
          (write-region
           "any text" nil file-notify--test-tmpfile1 nil 'no-message)
          (should (file-notify-add-watch
                   file-notify--test-tmpfile1 '(change) #'ignore))))
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
address@hidden:~/src/emacs-25 % gmake -C test/automated file-notify-tests 
SELECTOR='\"09\"'
Test file-notify-test09-sufficient-ressources condition:
    (file-error "Opening output file" "Too many open files in system" 
"/tmp/file-notify-test-parent11031I_Y/file-notify-test11031BbD")
   FAILED  1/2  file-notify-test09-sufficient-ressources
 
address@hidden:~/src/emacs-25 % ls /tmp/file-notify-test-parent11031I_Y | wc -l
   20291
--8<---------------cut here---------------end--------------->8---




2. Run limited number of file-notify-add-watch:

--8<---------------cut here---------------start------------->8---
      (let ((temporary-file-directory file-notify--test-tmpfile))
        (dotimes (_i 10000)
          (setq file-notify--test-tmpfile1 (file-notify--test-make-temp-name))
          (write-region
           "any text" nil file-notify--test-tmpfile1 nil 'no-message)
          (should (file-notify-add-watch
                   file-notify--test-tmpfile1 '(change) #'ignore)))
        (read))
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
address@hidden:~/src/emacs-25 % gmake -C test/automated file-notify-tests 
SELECTOR='\"09\"'
[...]

address@hidden:~ # lsof -p 11075 | grep file-notify-test | wc -l
   10000
--8<---------------cut here---------------end--------------->8---




Obviously, Emacs keeps an open file descriptor per watched file, as expected.

> -- Anders

Best regards, Michael.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]