free -m
-m表示以MB的单位显示
先用df -h确认要放虚拟内存文件的位置,假设为 /data/swap/swap1
创建2G的虚拟内存并启用:
dd if=/dev/zero of=/data/swap/swap1 bs=2G count=1mkswap /data/swap/swap1swapon /data/swap/swap1
Linux下建立虚拟内存
原文:http://www.cnblogs.com/windchen/p/6261725.html