In the past few weeks (possibly since I upgraded to Sierra) I keep getting this weird issue in iTerm2 using ZSH.
Basically, at intermittent points during my regular workflow, commands will stop working properly with the error:
_run-with-bundler:5: fork failed: resource temporarily unavailable
zsh: fork failed: resource temporarily unavailable
Does anybody know why this is happening, and how I can fix it?
This error might reflect a memory leak in your workflow. I had the issue with an automated script lately, and found that memory usage increased to around 100% before my program failed with this message.
You can generally check for memory leakage by running the Activity Monitor application on your Mac OS and navigating to the memory tab. There's also many ways to monitor memory from a zsh terminal, e.g. you can print out the number of processes with $ ps -eLf | wc -l
, or check free memory with free -m
.
If it is a memory issue, the best fix would be to rewrite your workflow to be more memory efficient. Another fix could be to increase your computer's limit on the processes it can run, e.g. by adding the following to your etc/profile
file;
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
References:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With