zoukankan      html  css  js  c++  java
  • gcc编译出错---make[5]: *** [s-attrtab] Killed

    内存不足导致的编译出错,解决方法是增加swapfile。

    root@ubuntu:home# swapon -s

    Filename    Type            Size    Used    Priority

    创建swapfile大小512M;

    root@ubuntu:home# dd if=/dev/zero of=/swapfile bs=1024 count=512k

    524288+0 records in

    524288+0 records out

    536870912 bytes (537 MB) copied, 8.54637 s, 62.8 MB/s

    应用&设置;

    root@ubuntu:/# mkswap /swapfile 

    Setting up swapspace version 1, size = 524284 KiB

    no label, UUID=f4719d4d-1d1f-49c9-b34e-b2af28e6374e

    root@ubuntu:/# swapon /swapfile 

    添加到开机启动项:

    root@ubuntu:/# vim /etc/fstab

    "/etc/fstab" 13L, 756C

    # /etc/fstab: static file system information.

    #

    # Use 'blkid' to print the universally unique identifier for a

    # device; this may be used with UUID= as a more robust way to name devices

    # that works even if disks are added and removed. See fstab(5).

    #

    # <file system> <mount point>   <type>  <options>       <dump>  <pass>

    # / was on /dev/sda1 during installation

    UUID=3fea2e6f-860e-40c6-8a43-296130837358 /    ext4    errors=remount-ro 0       1

    # swap was on /dev/sda5 during installation

    UUID=d1d5044f-57be-4eeb-a577-3e3bc99591a5 none     swap    sw   0       0

    /dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0

    /dev/sda2       /root/sda2       ext4    rw      0      1

    /swapfile       none     swap    default       0              0 

    ~                                                                       

    "/etc/fstab" 14L, 837C written

    root@ubuntu:home# swapon -s

    Filename      Type    Size    Used    Priority

    /swapfile     file  524284  8468    -1                                                                          

    root@ubuntu:/# free

                 total       used       free     shared    buffers     cached

    Mem:        506756     499228       7528       1104       2548     395148

    -/+ buffers/cache:     101532     405224

    Swap:       524284          0     524284

    重新编译,即可顺利编译完成gcc

  • 相关阅读:
    判断&数学&生活
    Tomcat7源码环境搭建
    CentOS 7 下使用虚拟环境Virtualenv安装Tensorflow cpu版记录
    Quartz学习笔记1:Quartz概述
    Docker学习笔记2: Docker 概述
    大数据基础知识问答----spark篇,大数据生态圈
    [MSSQL] [EntityFramework(.Net Core)] 自增长id字段,无法插入数据
    [json-server] RESTful API 中,取主数据时,同时获取多个关联子表的数据
    前后端分离开发之前端自己的API(DB)---- (2)
    前后端分离开发之前端自己的API(DB)---- (1)
  • 原文地址:https://www.cnblogs.com/wuxie1989/p/5853713.html
Copyright © 2011-2022 走看看