Suppose I am downloading file from internet with wget.
Now if I press CTRL + Z then it says process stopped.
Now I want to know that will it gets killed automatically or it will stay as it is. Will it consume any memory
|
feedback
|
|
It will stay. | |||||||||||||||
feedback
|
|
Even if the process does get killed, Linux will still keep it in memory. 99% of machines have more memory than they can actually use 99% of the time, so Linux keeps the program in memory on the chance that it will be run again soon. If it is, that saves the OS the trouble of loading the program from disk. If it's not, no harm done, the memory can be made free when needed. If the process is not killed, it can still be ejected from memory. Linux knows that it can load the program back in from disk. So it doesn't have to waste memory, if memory is precious, holding data that's not actually being currently accessed. So whether or not it uses up memory has nothing to do with whether the process terminates or not. Linux decides whether to keep things in memory based on recency of use, and either way it won't be being used. | |||
|
feedback
|
|
By pressing ctrl + z, you only suspend/pause the process. In this case, the process stays alive and consumes memory. To kill the process, use ctrl + c or the kill command. | |||
|
feedback
|
|
You can resume and bring the process to foreground using Or you can resume it in background with
| |||||||
feedback
|