【问题标题】:Don't have enough memory to build phantom.js - what to do?没有足够的内存来构建 phantom.js - 怎么办?
【发布时间】:2015-05-11 14:50:08
【问题描述】:

我正在尝试在 VPS 服务器(1Gb RAM)上编译 phantom.js。构建过程产生错误(持续):

obj/svg/SVGAllInOne.o svg/SVGAllInOne.cpp
{standard input}: Assembler messages:
{standard input}:168320: Warning: end of file not at end of a line;         
newline inserted
{standard input}: Error: open CFI at the end of file; missing              
.cfi_endproc directive
g++: internal compiler error: Killed (program cc1plus)

我在http://forum.qt.io/topic/22672/g-crash-when-compiling-qt5 发现了同一个文件的问题。人们在那里说:内存不够。

在这种情况下我该怎么办? Phantom.js 网站上的信息说它应该从源代码构建。

补充:这肯定是内存不足的情况,因为我刚刚从提供商那里收到消息说服务器内存不足。

【问题讨论】:

    标签: linux gcc build phantomjs


    【解决方案1】:

    您可以为您的 VPS 添加交换分区,也可以只添加交换文件来扩展您的虚拟内存:http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/

    您也可以尝试在其他具有更多内存的系统上构建 phantom.js,然后将其复制到目标 VPS。但您需要确保两个系统具有相同的架构和相同的环境(编译器版本、库等)。

    【讨论】:

    • 谢谢,我现在正在阅读有关交叉编译的信息,我认为是这样。我会尽量确保库和编译器的版本是相同的。第一个不是我的选择,因为托管服务提供商没有授予管理交换的权限。
    【解决方案2】:

    我遇到了同样的问题。我通过 --jobs 1 重新运行 build.sh,它成功了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-01
      • 2018-05-11
      • 2019-11-18
      相关资源
      最近更新 更多