I'm doing web development and have Ruby running a bunch of tasks.. Grunt serve, Sublime plugins, Brew etc... Nothing fancy. Just some npm installs and a grunt serve command inherited from Yeoman/Assemble

It recently started using 100% CPU and I'm not sure how to rescue my CPU without restarting.

Can I kill Ruby and then relaunch it?

How can I figure out what's causing the issue?

I cancelled out all the commands that were running in terminal windows and shut down Sublime Text and it is still hovering around 100% CPU usage and my fan is a blowin'.

Using OSX Yosemite, iTerm2, Ruby 2.0.0

  • Specifically, I would recommend using RVM (Ruby Version Manager) instead of the built in Ruby in Mac OS X since Ruby 2.0.0 is memory leak prone and the most stable release is 2.1.5. – JakeGould Jan 21 '15 at 22:52

If you run top -u in a Terminal, it will show you what processes are running, sorted in descending order by CPU usage. This should reveal to you who the culprit is (ruby or otherwise). You should see the process ID (PID) of that process in the top output. Then you can quit top (hit q) and do kill pid where pid is the pid of what you want to kill.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.