Swap Space
Swap Calculation
RAM Size | Swap Size | (Swap + Hibernate) Size | RAM Size | Swap Size | (Swap + Hibernate) Size | |
---|---|---|---|---|---|---|
256MB | 256MB | 512MB | 512MB | 512MB | 1GB | |
1GB | 1GB | 2GB | 2GB | 1GB | 3GB | |
3GB | 2GB | 5GB | 4GB | 2GB | 6GB | |
6GB | 2GB | 8GB | 8GB | 3GB | 11GB | |
12GB | 3GB | 15GB | 16GB | 4GB | 20GB | |
24GB | 5GB | 29GB | 32GB | 6GB | 38GB | |
64GB | 8GB | 72GB | 96GB | 9GB | 105GB | |
128GB | 11GB | 139GB |
Update » Ubuntu » 22.04
echo 'swapon --show'|sudo bash
:'
NAME TYPE SIZE USED PRIO
/swapfile file 2G 1.4G -2
'
cat <<'EXE' | sudo bash
swapoff /swap.img
fallocate -l 29G /swap.img
ls -lh /swap.img && mkswap /swap.img
swapon /swap.img && swapon --show && free -th
EXE
Update » Ubuntu » 24.04
echo 'swapon --show'|sudo bash
:'
NAME TYPE SIZE USED PRIO
/swap.img file 6G 0B -2
'
cat <<'EXE' | sudo bash
swapoff /swap.img
fallocate -l 38G /swap.img
ls -lh /swap.img && mkswap /swap.img
swapon /swap.img && swapon --show && free -th
EXE
Update » Raspberry Pi 4
cat <<'EXE' | sudo bash
printf '\nbefore:\n';free -th
sed -i 's|CONF_SWAPSIZE=100|CONF_SWAPSIZE=2048|' /etc/dphys-swapfile
service dphys-swapfile restart
printf '\nupdate:\n';free -th
EXE
Playground
echo 'sync;echo 3 >/proc/sys/vm/drop_caches && swapoff -a && swapon -a'|sudo bash
free -th
|
sudo swapon --show
cat /etc/fstab
| |
| ||
docker network prune -f
docker volume prune -f
docker system prune -f
docker image ls
|
cat <<'EXE' | bash
for d in system network volume
do docker ${d} prune -f;done
EXE
|
cat <<'EXE' | ssh [email protected]
for d in system network volume
do docker ${d} prune -f;done
EXE
|
| ||
References
| ||