Notice: Unexpected clearActionName after getActionName already called in /var/www/html/includes/context/RequestContext.php on line 338
Turning on swap with a page file - Leo's Notes

Turning on swap with a page file

From Leo's Notes
(Redirected from Swap)
This page was last edited on 15 June 2020, at 02:03.

To enable swap on a system that has no dedicated swap partition (such as a really small VPS or VM), create a swap file:

## 1GB swap file
# dd if=/dev/zero of=/swap bs=1M count=1024
# chmod 600 /swap
# mkswap /swap
# swapon /swap
# echo "/swap swap swap defaults 0 0" >> /etc/fstab

Naturally, the swap space here incurs the filesystem overhead as well.