部署在阿里云ECS上的Nodejs项目,总是不间断的出现:Malloced operator new Allocation failed - process out of memory
发布于 8 年前 作者 bjxiaowanzi 5399 次浏览 来自 问答

错误详细信息如下:

<--- Last few GCs --->

    1110 ms: Scavenge 20.6 (51.0) -> 14.2 (51.0) MB, 1.4 / 0 ms [allocation fail
ure].
    1273 ms: Scavenge 21.3 (52.0) -> 15.9 (54.0) MB, 2.5 / 0 ms [allocation fail
ure].
    1479 ms: Scavenge 23.5 (54.0) -> 17.8 (55.0) MB, 2.2 / 0 ms [allocation fail
ure].
    1748 ms: Scavenge 26.0 (56.0) -> 20.4 (57.0) MB, 3.0 / 0 ms [allocation fail
ure].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 000003308ABB4639 <JS Object>
    2: /* anonymous */(aka /* anonymous */) [C:\Users\Administrator\blog-express
4\node_modules\mongoose\node_modules\bson\lib\bson\parser\deserializer.js:36] [p
c=0000016CAF81CEB3] (this=000003308AB041B9 <undefined>,buffer=000002AA885F5219 <
an Uint8Array with map 000003749D89F0D1>,options=000002AA885F51D9 <an Object wit
h map 000003749D8B6049>,isArray=000003308AB041B9 <undefined>)
    3: argume...

FATAL ERROR: Malloced operator new Allocation failed - process out of memory

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v4.4.3
npm ERR! npm  v2.15.1
npm ERR! code ELIFECYCLE
npm ERR! blog@0.0.0 start: `node ./bin/www`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the blog@0.0.0 start script 'node ./bin/www'.
npm ERR! This is most likely a problem with the blog package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./bin/www
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs blog
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls blog
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Administrator\blog-express4\npm-debug.log

是因为这台机器的配置低下吗?我查了下,看到这个,但好像没得到有用的信息 望指点,谢谢

5 回复

我没出现过,你用的node是最新版本么? 我是用pm2启动的

换个nodejs版本试试

没出现过这种问题 你用pm2启动项目并监控一下 是什么问题

单从你给出的信息推测,跟服务器没关系,是你的进程内存超过单个进程最大限制(V8限定)引起的。可以尝试在本地试下,是否也有这样的问题;

在服务器里使用free -m,看是否服务器内存不足~~~

回到顶部