有时会遇到内存不够用的情况,可以使用本文提供的方法进行临时增加交换分区。
#制作交换分区——得到文件 [root@serv01 linux-2.6.38]# dd if=/dev/zero of=/swap.img bs=1M count=1024 1024+0 records in 1024+0 records out 1073741824 bytes (1.1 GB) copied, 2.68989 s, 399 MB/s [root@serv01 linux-2.6.38]# ls swap.img #制作交换分区 [root@serv01 linux-2.6.38]# mkswap /swap.img mkswap: swap.img: warning: don't erase bootbits sectors on whole disk. Use -f to force. Setting up swapspace version 1, size = 1048572 KiB no label, UUID=70945855-7bab-4c08-a880-77d089dd06cc #使交换分区生效 [root@serv01 linux-2.6.38]# swapon /swap.img #可以使用free命令查看是否增加成功 [root@serv01 linux-2.6.38]# free total used free shared buffers cached Mem: 384996 378700 6296 0 33232 249252 -/+ buffers/cache: 96216 288780 Swap: 2097136 0 2097136 #关闭,然后删除 [root@serv01 linux-2.6.38]# swapoff /swap.img [root@serv01 linux-2.6.38]# rm -rf /swap.img
我的邮箱:wgbno27@163.com 新浪微博:@Wentasy27 微信公众平台:JustOracle(微信号:justoracle) 数据库技术交流群:336882565(加群时验证 From CSDN XXX) Oracle交流讨论组:https://groups.google.com/d/forum/justoracle By Larry Wen
@Wentasy 博文仅供参考,欢迎大家来访。如有错误之处,希望批评指正。原创博文如需转载请注明出处,谢谢 :) [CSDN博客] |