# dd if=/dev/zero of=/swap bs=1024 count=1M
Format the swap file:
# mkswap /swap
Enable the swap file:
# swapon /swap
Enable swap on boot:
# echo "/swap swap swap sw 0 0" >> /etc/fstab
相关文章
- 阿里云ECS云服务器编译安装PHP遇到virtual memory exhausted: Cannot allocate memory
- 关于阿里云ESC上go语言项目编译6l: running gcc failed: Cannot allocate memory
- virtual memory exhausted: Cannot allocate memory
- virtual memory exhausted: Cannot allocate memory
- virtual memory exhausted: Cannot allocate memory
- php编译 :virtual memory exhausted: Cannot allocate memory
- 安装Php时候报错信息:virtual memory exhausted: Cannot allocate memory (不能分配内存)