centos解决“c++: internal compiler error: Killed (program cc1plus)”错误

1.问题描述
在测试vm上编译安装mysql的时候报了一个错

c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report

主要是在编译过程中,内存不够造成的。
2.解决方案

使用swap创建临时分区
sudo dd if=/dev/zero of=/swapfile bs=64M count=32
#count的大小就是增加的swap空间的大小,64M是块大小,所以空间大小是bs*count=2048MB
sudo mkswap /swapfile
#把刚才空间格式化成swap格式
chmod 0600 /swapfile
#该目录权限,不改的话,在下一步启动时会报“swapon: /swapfile: insecure permissions 0644, 0600 suggested.”错误
sudo swapon /swapfile
#使用刚才创建的swap空间

3.工作做完可以把临时空间关闭

swapoff -a
#详细的用法可以:swapoff --help
#查看当前内存使用情况:free -m
posted @ 2021-04-20 17:53  MR__Wang  阅读(1052)  评论(0编辑  收藏  举报