Sometimes it is necessary to identify the application or process, over-consuming resources on your Mac. Usually used for this purpose monitoring system, which are voracious application and complete it forcibly. This method is quite rough and not quite "humane" because the forced termination application can cause data loss. Instead, it is more convenient to use the kill command Terminal, which is painless can temporarily suspend a process or application, and then continue its execution.
* * *
How to stop and start the application using the PID
This method is preferred because it is actually used in the system default, with the only difference that you can add to the team a different key influencing its behavior (in this case, the suspension of application). It also allows you to stop the program quickly, which means that the termination of the implementation of its code and, as a consequence, reduced system resource consumption.
The first thing we need to learn the PID application that we're going to suspend. PID - this process ID, the license application ID, which is displayed on the tab
CPU, in monitoring system. For example, PID iTunes I - 525 (you it will be different).open the Terminal (From the folder Programs — Utilities or through Spotlight) And trying to drive the following command (substituting PID applications):kill -STOP PID
Immediately after that, the music will stop playing (if it is running), and the application will be suspended. code execution is completely stopped and it shall be deemed unresponsive (in monitoringsystem status displays - Notresponds).
To restart the application, and use the command kill, But with a different key, that's how it looks:
kill -CONT PID
Note. Do not close the terminal, until the application continue to work with the current PID, otherwise in the future, problems may arise if you want it to continue, and the PID will already be assigned to another process.
How to stop and start the application using the AppName
If you have any problems with the previous method, or you do not want to bother with the PID, which is every time you start application changes - is possible to use another method of working with the application name (AppName), which in contrast to the PID, always consistently.
To do this we use the command killall with the familiar keys. Remember the name of the application or look at it in monitoringsystem and substituted in the following command:
killall -STOP "AppName"
To continue, as you may have guessed, we need to use the same command, but with the key -CONT. It looks like this:
killall -CONT "AppName"
After this operation the application will be restarted and you will immediately get back to it.
Note. Quotes can be left out if the name of the application consists of a single word. If it contains spaces, it must necessarily be quoted.
Finally, we recall that the team killall in its pure form (without any keys) to instantly complete any application. If this system OS X applications such as Finder, Dock - they will just restart.
* * *
We have questions, comments or suggestions? Welcome to the comments - I'm always happy to talk and help. Stay tuned, there is still a lot of interesting things!