Will any running process be killed if I free the swap memory from my Ubuntu server?

The question (title of this question) came into my thought for the below reason. If anyone gives a solution of that reason then I don’t need to free the swap memory.

The Reason:

After installation of Jenkins it is running well. But using some minutes (or hour) it was automatically stopped. When I restart the service (by the command sudo service jenkins restart) it starts again to work. Similarly after some times it is automatically stopped again (i.e, I can’t find the jenkins in the target url MY_IP_ADDERSS:8080) but whenever I check the status of the jenkins (sudo service jenkins status) it shows active (exited).

I checked my server memory. There is about 20% free of memory of RAM but the swap memory is 100% full. I guess the problem belongs to that swap memory (I don’t know whether I am right or wrong)

If there any solution of this problem please help me first.

Now my question is:

If there any problem If I free up my swap memory ?

Will the running processes (or any process among them) be killed if I try to this ?

Please help, this is my first question in this site.

Answer

Paging space, AKA swap space, is used when there is memory pressure. As permanent storage is much slower than DRAM, excessively paging out is bad performance for most workloads. If RAM + paging space runs out completely, on Linux the OOM killer will attempt to find a heavy allocating task and kill it. The alternative is to panic and reboot.

Some slow rate of paging out is acceptable. However, your process died mysteriously. Also, Linux memory management will not fill paging space to 100% and RAM to 80%, something reclaimed a lot of memory. By killing a task; if you look through your log files you will find the OOM killer.

OOM killer is a symptom of a failed capacity planning process. The solutions are:

  • Reduce memory consumption of the application. For example, reduce shared memory of databases,
    or reduce heap for runtimes (JVM).
  • Increase RAM allocated to the host. DRAM is relatively inexpensive, and still faster than even solid state storage.

Attribution
Source : Link , Question Author : Shamim , Answer Author : John Mahowald

Leave a Comment