随意教程 Linux开启Swap 1.查看当前是否已有 Swap free -hfree -h 2.创建 Swap 文件 以创建一个 2G 的 Swap 文件为例(可改成 1G、4G 等): fallocate -l 2G /swapfilefallocate -l 2G admin 7