在 VSP 中为乘客编写 apache 时出错"out of memory allocating"

Error "out of memory allocating" at compling passenger for apache in a VSP

本文关键字:出错 out of allocating memory apache VSP 乘客      更新时间:2023-10-16

我在VPS (OpenVz)中运行debian 7.0 (amd64) 1GB Ram, 512MB SWAP并尝试安装OpenProject。但是如果我尝试用

为Apache编译Passenger
passenger-install-apache2-module

我得到以下错误信息:

cc1plus: out of memory allocating 2048 bytes after a total of 5304320 bytes
rake aborted!
Command failed with status (1): [c++ -Iext -Iext/common -Iext/libev -fPIC -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_REENTRANT -I/usr/include -I/usr/include/apr-1.0 -I/usr/include/openssl -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -fcommon -feliminate-unused-debug-symbols -feliminate-unused-debug-types -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -Wno-attributes -ggdb -DHAS_ALLOCA_H -DHAVE_ACCEPT4 -DHAS_SFENCE -DHAS_LFENCE -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -std=gnu++11 -DHASH_NAMESPACE="__gnu_cxx" -DHASH_MAP_HEADER="<hash_map>" -DHASH_MAP_CLASS="hash_map" -DHASH_FUN_H="<hash_fun.h>" -o buildout/apache2/module_libpassenger_common/Logging.o -c ext/common/Logging.cpp]
/home/openproject/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.41/build/cplusplus_support.rb:51:in `run_compiler'
/home/openproject/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.41/build/cplusplus_support.rb:61:in `compile_cxx'
/home/openproject/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.41/lib/phusion_passenger/common_library.rb:133:in `block (2 levels) in define_category_tasks'
Tasks: TOP => apache2 => buildout/apache2/mod_passenger.so => buildout/apache2/module_libpassenger_common/Logging.o

我认为问题是,我的交换分区太小了,但我不能设置更多,因为OpenVz虚拟化

 swapon failed: Operation not permitted
谁有解决这个问题的办法?谢谢你们了!

您必须获得具有更多RAM的服务器,或者不使用OpenVZ的服务器,以便您可以启用交换。对不起。