I got a problem with my swap space.
I got a small server with 1Gb ram.
It is getting to its limit.
It want to swap out memory but because there is no partition for swap,
so it is killing some processes.
How can i fix this, without adding a partition ?
swap partition not present
Re: swap partition not present
You can choose to add a swap-file.
Similar to what windows does.
you create a swap-file, usually in root. But do it on the partition with the most space.
Usually you take 2 times the available ram, 1G ram x 2 = 2G swapfile.
Assign it read/write permissions for root only (not strictly needed, but more secure)
Format as swap:
And activate it for the current session (no reboot needed)
You can verify with:
Similar to what windows does.
you create a swap-file, usually in root. But do it on the partition with the most space.
Code: Select all
sudo fallocate -l 2G /swapfile
Assign it read/write permissions for root only (not strictly needed, but more secure)
Code: Select all
sudo chmod 600 /swapfile
Code: Select all
sudo mkswap /swapfile
Code: Select all
sudo swapon /swapfile
You can verify with:
Code: Select all
swapon -s