2GBのスワップの作成例
1 2 3 4 5 |
$ sudo fallocate -l 2G /swapfile $ sudo chmod 600 /swapfile $ sudo mkswap /swapfile $ sudo swapon /swapfile $ sudo sh -c 'echo "/swapfile none swap sw 0 0" >> /etc/fstab' |
topコマンドで確認
1 2 3 4 5 6 7 |
$ top top - 13:08:27 up 2:59, 1 user, load average: 0.00, 0.01, 0.05 Tasks: 68 total, 2 running, 66 sleeping, 0 stopped, 0 zombie %Cpu(s): 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem : 501144 total, 118128 free, 65832 used, 317184 buff/cache KiB Swap: 2097148 total, 2097148 free, 0 used. 342616 avail Mem |