Skip to content

Instantly share code, notes, and snippets.

@bbugh
Created March 19, 2019 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbugh/e7e8ed0c3ff158e22e733b2766666829 to your computer and use it in GitHub Desktop.
Save bbugh/e7e8ed0c3ff158e22e733b2766666829 to your computer and use it in GitHub Desktop.
Find out what process is using the "Too many open files" issue on Mac
# taken from this answer on stack exchange: https://superuser.com/a/1180084
# This will show the number of files open by all of the processes
sudo lsof -n | cut -f1 -d' ' | uniq -c | sort | tail
# When you find out which one is using the most files, see what files are being used by it
sudo lsof -n | grep java
# In my case, it's always java because elasticsearch doesn't clean up after being on for weeks, I guess
brew services restart elasticsearch
# ta da, no more "out of files"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment