J
J
JIakki2016-06-28 21:55:00
linux
JIakki, 2016-06-28 21:55:00

How to automatically clear RAM if it is full?

When the RAM is full, then the system hangs tightly.
What can you do about it? I use archlinux
Thanks

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
sim3x, 2016-06-28
@JIakki

https://bbs.archlinux.org/viewtopic.php?id=158774
but it's better to lock the program that eats RAM

A
Andrey Burov, 2016-06-28
@BuriK666

disable swap, then oom-killer will kill processes if there is not enough memory.

T
TyzhSysAdmin, 2016-06-28
@POS_troi

find a software with a memory leak, unsubscribe to the developers about the problem and wait for a patch.
If heavy software is used that really needs a lot of RAM, then actually add RAM.
so look at the top who devours the RAM and unsubscribe, the manna has already run out for today and the telepaths have gone to charge :)

M
Mr_Floppy, 2016-06-28
@Mr_Floppy

Add a swap partition, when the RAM runs out everything will slow down, but at least somehow work.

V
Victor Taran, 2016-06-29
@shambler81

At one time, a patch was needed, but the curve worked.

#!/bin/bash
# Делаем релоад апачь, если свободной памяти меньше 1 гб.
a=$(free -m -o | grep "Mem:" | awk {'print $4'})
if [ $a -lt 1024 ]
then
/etc/init.d/httpd reload
echo `date`>> /var/log/restart.txt
#чистим  swap - может занять минут 10 
swapoff -a && swapon -a

fi

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question