Linux内存不足增加虚拟内存的方法
2015-01-07 10:47
274 查看
a) Login as the root user SSH登录root 账户
b) Type following command to create 2G swap file (1024 * 2048MB = 2097152 block size):
dd if=/dev/zero of=/swapfile1 bs=1024 count=2097152
c) Set up a Linux swap area:
mkswap /swapfile1
d) Activate /swapfile1 swap space immediately:
swapon /swapfile1
e) To activate /swapfile1 after Linux system reboot, add entry to /etc/fstab file. Open this file using text editor such as vi:
vi /etc/fstab
Append following line:
/swapfile1 swap swap defaults 0 0
So next time Linux comes up after reboot, it enables the new swap file for you automatically.
g) How do I verify swap is activated or not?
Simply use free command:
$ free -m
如果想关闭虚拟内存或者向扩大, 要先disable
swapoff /swapfile1
相关文章推荐
- Linux下虚拟内存不足怎么办,如何快速增加swap分区
- Linux中增加虚拟内存的方法
- win7系统内存不足 增加虚拟内存
- Linux上通常增加虚拟内存(swap交换分区)的两种方法
- digital ocean 内存不足时增加swap文件的方法
- Linux下虚拟内存不足怎么办,如何快速增加swap分区
- 【原】内存不够时增加虚拟内存的方法
- linux设置虚拟内存(swap)解决mysql因内存不足挂掉的故障
- excel导出时”内存或磁盘空间不足“错误的解决方法
- linux中增加swap分区文件的步骤方法
- weblogic域内存增加方法
- [转]Linux 下判断Server 内存是否不足
- linux中增加swap分区文件的步骤方法
- Tomcat6内存不足问题及解决方法
- Linux 释放内存方法
- 虚拟内存不足的解决方法
- Tomcat6内存不足解决方法
- Tomcat6内存不足问题及解决方法
- 查看Linux内核、CPU、内存及各组件版本的命令和方法
- 使用 MMAnalyzer 发现内存不足 (out of memory java heap)解决方法