堆内存不足错误后服务器崩溃

时间:2019-06-15 08:09:46

标签: node.js mongodb express webserver

我有一个正在生产中运行的MEAN堆栈应用程序。 服务器因错误而崩溃:

<---后几个GC --->

6957458 ms: Mark-sweep 1383.6 (1440.0) -> 1383.6 (1440.0) MB, 949.0 / 0.0 ms [allocation failure] [GC in old space requested].
6958399 ms: Mark-sweep 1383.6 (1440.0) -> 1383.1 (1440.0) MB, 940.6 / 0.0 ms [allocation failure] [GC in old space requested].
6959353 ms: Mark-sweep 1383.1 (1440.0) -> 1386.0 (1422.0) MB, 953.5 / 0.0 ms [last resort gc].
6960311 ms: Mark-sweep 1386.0 (1422.0) -> 1389.1 (1422.0) MB, 958.1 / 0.0 ms [last resort gc].

<--- JS堆栈跟踪--->

==== JS堆栈跟踪======================================== =

安全上下文:0x2a532fdcf781 3:onconnection [net.js:〜1446] [pc = 0x33062833f99b](this = 0x3a1cb787c31,err = 0,clientHandle = 0x169621337ef9)

====详细信息========================================== ======

[3]: onconnection [net.js:~1446] [pc=0x33062833f99b] (this=0x3a1cb787c31 <a TCP with map 0x26849a6553a9>,err=0,clientHandle=0x169621337ef9 <a TCP with map 0x26...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [MyApp]
2: 0x7d027c [MyApp]
3: v8::Utils::ReportApiFailure(char const, char const) [MyApp]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [MyApp]
5: v8::internal::Factory::NewFixedArray(int, v8::internal::PretenureFlag) [MyApp]
6: v8::internal::TypeFeedbackVector::New(v8::internal::Isolate*, v8::internal::Handle<v8::internal::TypeFeedbackMetadata>) [MyApp]
7: 0xa63270 [MyApp]
8: 0xa63869 [MyApp]
9: 0xa65c60 [MyApp]
10: 0xa6d326 [MyApp]
11: v8::internal::Compiler::Compile(v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Compiler::ClearExceptionFlag) [MyApp]
12: v8::internal::Runtime_CompileLazy(int, v8::internal::Object*, v8::internal::Isolate) [MyApp]
13: 0x3306283092a7
Aborted (core dumped)

npm ERR! Linux 4.15.0-1033-gcp
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v6.17.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! MyApp-Dashboard@0.0.0 start: `node ./bin/www`
npm ERR! Exit status 134
npm ERR! 
npm ERR! Failed at the MyApp-Dashboard@0.0.0 start script 'node ./bin/www'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the MyApp-Dashboard 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 MyApp-Dashboard
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls MyApp-Dashboard
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR! /home/MyApp/MyApp/web-server/npm-debug.log

我的应用正常运行了大约2-3个月,然后进行了一次更新。 给出此错误,它崩溃了。

现在,我每天必须重新启动服务器2-3次。

仍然试图找出问题所在,但仍然找不到。

0 个答案:

没有答案