Suspending Processes

One feature that seems ubiquitous to all operating systems is the ability to suspend processes. While the process is suspended, the process will not utilize any CPU and the RAM utilized by the process will be frozen (no new allocations or deallocations).

It is important to note that any timers that the process might use are also suspended and then when the process resumes, suspended timers or any time tracking component might be overwhelmed by the amount of time that passed. Trivially, any processes requiring a permanent network connection will not work for the duration of time that the process is suspended.

On Windows, using the Resource Monitor tool provided by Windows, a process can be suspended by searching for its name and then right-clicking and selecting Suspend Process. Later, the process can be resumed by selecting it from the Resource Monitor, right-clicking and selecting Resume Process.

On Linux, delivering the SIGSTOP signal to a process will suspend the process, ie:

kill -s STOP PID

where:

At a later time, the process can be resumed by delivering the SIGCONT signal to the suspended process:

kill -s CONT PID

where:

Usefulness

Take the example of a large and complicated program that is running in the foreground that takes a long time to start and initialize. Similarly, assume that plenty of RAM is available but not much CPU or GPU power is available to the machine that hosts the process. Furthermore, a followup assumption could be the possibility of a process leaking memory over time such that the process ends up consuming all the RAM available to the machine (a practical scenario is qBittorrent running in a browser that ends up using the entire RAM due to leaks, other examples are games that are meant to run for a few hours at a time but will leak when they have been running for a long time).

In such cases, suspending and resuming a process is a handy feature that will allow the process to be resumed instantly but for the time that the process is suspended, no additional RAM nor CPU will be used.