Archiv nach Monaten: Dezember 2015

Stopping and pausing processes in MAC OSX

I had a problem in the last days with processes running in the backround with high processor utilisation. Exactly I am recoding all my videos to X.265 in order to reclaim space for my video collection. But the encoding takes a lot of time.
So sometimes I just need to pause this process in order to use my laptop on battery.
The secret here is to use the kill command with the right signal. You use
kill -STOP <process number>
and to continue
kill -CONT <process number>
If you dont want to search with ps for the correct process number you can also use killall. In my case with HandBrakeCLI is looks like this:
killall -STOP HandBrakeCLI
killall -CONT HandBrakeCLI

The process will remain in memory but will not consume any CPU resources. You can say the process “sleeps”. With CONT it will continue processing.