Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/govim: use of fsnotify holds too many open files on macOS #464

Closed
myitcv opened this issue Aug 20, 2019 · 3 comments · Fixed by #477
Closed

cmd/govim: use of fsnotify holds too many open files on macOS #464

myitcv opened this issue Aug 20, 2019 · 3 comments · Fixed by #477
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed
Milestone

Comments

@myitcv
Copy link
Member

myitcv commented Aug 20, 2019

What version of Vim/Gvim are you using?

Vim/Gvim version
$ vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Jul  5 2019 16:04:22)
macOS version
Included patches: 1-1518
Compiled by pauljolly@Pauls-MacBook-Pro.local
Huge version without GUI.  Features included (+) or not (-):
+acl               -farsi             -mouse_sysmouse    -tag_any_white
+arabic            +file_in_path      +mouse_urxvt       -tcl
+autocmd           +find_in_path      +mouse_xterm       +termguicolors
+autochdir         +float             +multi_byte        +terminal
-autoservername    +folding           +multi_lang        +terminfo
-balloon_eval      -footer            -mzscheme          +termresponse
+balloon_eval_term +fork()            +netbeans_intg     +textobjects
-browse            -gettext           +num64             +textprop
++builtin_terms    -hangul_input      +packages          +timers
+byte_offset       +iconv             +path_extra        +title
+channel           +insert_expand     -perl              -toolbar
+cindent           +job               +persistent_undo   +user_commands
-clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +virtualedit
+cmdline_hist      +langmap           -python            +visual
+cmdline_info      +libcall           -python3           +visualextra
+comments          +linebreak         +quickfix          +viminfo
+conceal           +lispindent        +reltime           +vreplace
+cryptv            +listcmds          +rightleft         +wildignore
-cscope            +localmap          -ruby              +wildmenu
+cursorbind        -lua               +scrollbind        +windows
+cursorshape       +menu              +signs             +writebackup
+dialog_con        +mksession         +smartindent       -X11
+diff              +modify_fname      -sound             -xfontset
+digraphs          +mouse             +spell             -xim
-dnd               -mouseshape        +startuptime       -xpm
-ebcdic            +mouse_dec         +statusline        -xsmp
+emacs_tags        -mouse_gpm         -sun_workshop      -xterm_clipboard
+eval              -mouse_jsbterm     +syntax            -xterm_save
+ex_extra          +mouse_netterm     +tag_binary        
+extra_search      +mouse_sgr         -tag_old_static    
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/Users/pauljolly/usr/vim/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -L/usr/local/lib -o vim        -lm -lncurses  -liconv -framework AppKit           

What version of Go are you using (go version)?

$ go version
go version go1.12.6 darwin/amd64

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/pauljolly/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/pauljolly/gostuff"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.6/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.6/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/dr/dr09wv9n7l9_j_z635q0p7rr0000gp/T/go-build502338012=/tmp/go-build -gno-record-gcc-switches -fno-common"

What version/commit of govim are you using?

b6bbbae

What is the output of :messages in Vim?

n/a

Do the Vim channel, govim or gopls log files show anything interesting?

n/a

How did you install govim?

n/a

What did you do?

Open govim.go in a clone of this repo

What did you expect to see?

A small number of open files reported by lsof for the govim process

What did you see instead?

~255 files open, i.e. all of the files in the govim repo. These files are open because fsnotify uses a slightly old mechanism for watching files on macOS: fsnotify/fsnotify#11

@myitcv myitcv added the bug Something isn't working label Aug 20, 2019
@myitcv myitcv added this to the Unplanned milestone Aug 20, 2019
@myitcv
Copy link
Member Author

myitcv commented Aug 20, 2019

cc @leitzler

@myitcv
Copy link
Member Author

myitcv commented Aug 20, 2019

One option appears to be using https://github.com/fsnotify/fsevents

@myitcv myitcv added the help wanted Extra attention is needed label Aug 20, 2019
@leitzler
Copy link
Member

leitzler commented Sep 2, 2019

I'll try out fsevents just because this bites me a little bit too often (and I would just forget about this issue if I changed my default ulimit) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants