Linux编译时:virtual memory exhausted: Cannot allocate memory
来源:互联网 发布:安卓看美剧用什么软件 编辑:程序博客网 时间:2024/05/21 10:20
在执行free -m的是时候提示Cannot allocate memory:
(swap文件可以放在自己喜欢的位置如/var/swap)
- [root@Byrd byrd]# free -m
- total used free shared buffers cached
- Mem: 512 108 403 0 0 28
- -/+ buffers/cache: 79 432
- Swap: 0 0 0
- [root@Byrd ~]# mkdir /opt/images/
- [root@Byrd ~]# rm -rf /opt/images/swap
- [root@Byrd ~]# dd if=/dev/zero of=/opt/images/swap bs=1024 count=2048000
- 2048000+0 records in
- 2048000+0 records out
- 2097152000 bytes (2.1 GB) copied, 82.7509 s, 25.3 MB/s
- [root@Byrd ~]# mkswap /opt/images/swap
- mkswap: /opt/images/swap: warning: don't erase bootbits sectors
- on whole disk. Use -f to force.
- Setting up swapspace version 1, size = 2047996 KiB
- no label, UUID=59daeabb-d0c5-46b6-bf52-465e6b05eb0b
- [root@hz mnt]# swapon /opt/images/swap
- [root@hz mnt]# free -m
- total used free shared buffers cached
- Mem: 488 481 7 0 6 417
- -/+ buffers/cache: 57 431
- Swap: 999 0 999
内存太小,增加内存可以解决。
使用完毕后可以关掉swap:
- [root@hz mnt]# swapoff swap
- [root@hz mnt]# rm -f /opt/images/swap
swap文件也可以不删除,留着以后使用,关键是你的虚拟机硬盘够用。
阅读全文
0 0
- Linux编译时:virtual memory exhausted: Cannot allocate memory
- 编译时:virtual memory exhausted: Cannot allocate memory
- 编译时:virtual memory exhausted: Cannot allocate memory
- 编译时:virtual memory exhausted: Cannot allocate memory
- 编译时:virtual memory exhausted: Cannot allocate memory
- 编译时:virtual memory exhausted: Cannot allocate memory
- 编译QT程序出现virtual memory exhausted: Cannot allocate memory
- 编译出现错误virtual memory exhausted: Cannot allocate memory
- virtual memory exhausted: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
- 云端Ubuntu:Virtual memory exhausted:Cannot allocate memory
- PHP源码安装出现virtual memory exhausted: Cannot allocate memory
- android4.4编译失败,出现“virtual memory exhausted: Cannot allocate memory”
- linux下由于内存不足造成的 virtual memory exhausted: Cannot allocate memory, qt **.o文件 file not found
- 滴滴云服务器安装php的时候报错virtual memory exhausted: Cannot allocate memory make: *** [ext/fileinfo/libmagic/ap
- http域名跳转到https域名
- C语言中的联合体
- 霍夫变换直线检测基本原理
- Eigen: C++开源矩阵计算工具——Eigen的简单用法
- 字符串匹配:暴力,KMP,horsepool实现(1)
- Linux编译时:virtual memory exhausted: Cannot allocate memory
- 动态库链接framework合并
- Kotlin 实战翻译 —— 仿微信图片选择开源库ImagePicker
- 1052. 卖个萌
- 数据结构-KMP算法
- 高德地图(Attempt to invoke virtual method 'void com.amap.api.maps.MapView.onDestroy()' on a null object)
- java中trim()方法是用来干什么的? 所有起始和结尾的空格都被删除
- Java定时任务接口ScheduledExecutorService代替Timer
- 简单学习二维码生成步骤--java代码实现