swap 內存不足

參考:https://stackoverflow.com/questions/5682854/why-is-the-linker-terminating-on-me-when-i-build-clangcentos

   https://unix.stackexchange.com/questions/294600/i-cant-enable-swap-space-on-centos-7ui

虛擬機編譯cLang 編譯器報錯以下:spa

collect2: error: ld terminated with signal 9 [Killed]unix

緣由: ld很是耗內存,它須要把全部object文件加載到內存,進行處理。blog

解決辦法: 增長swap空間, 步驟以下:內存

這裏主要說明fallocate分配swap空間,致使swapon報錯,invalid argument,緣由以下:get

用第二種方法分配swap空間,連接經過。編譯器

設置開機啓用swap文件:虛擬機

在/etc/fstab文件中添加一行:it

 /mnt/10GB.swap                            swap                    swap    defaults        0 0

相關文章
相關標籤/搜索