Swap

Slobodno memorije i stanje swap-a:
free -h

Kreiranje swap datoteke od 2GB (2048k):
cd /var
touch swap.img
chmod 600 swap.img
dd if=/dev/zero of=/var/swap.img bs=2048k count=1000
mkswap /var/swap.img
swapon /var/swap.img
cp /etc/fstab /etc/fstab.noswap
echo "/var/swap.img    none    swap    sw    0    0" >> /etc/fstab

Koristi swap u slučaju da je ostalo samo 20% memorije i omogućiti kernelu commitanje puno memorije :
sysctl -w vm.swappiness=20
sysctl -w vm.overcommit_memory=1
http://www.oracle.com/technetwork/articles/servers-storage-dev/oom-killer-1911807.html

Comments