我的应用程序在x时间后崩溃,一个mongo db收集了大约150000个文档。
我的应用:nginx - phusion-passenger - node.js
在这个应用程序中,有一个函数可以查找带有verif日期的文档(date.now - 4h)并更新返回的文档。
但是应用程序崩溃了,错误:
App 31178 stderr: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
App 31178 stdout:
App 31178 stdout: <--- Last few GCs --->
App 31178 stdout:
App 31178 stdout: 11293603 ms: Scavenge 1397.0 (1458.1) -> 1397.0 (1458.1) MB, 0.5 / 0 ms (+ 3.0 ms in 1 steps since last GC) [allocation failure] [incremental marking delaying mark-sweep].
App 31178 stdout: 11294683 ms: Mark-sweep 1397.0 (1458.1) -> 1396.9 (1458.1) MB, 1079.7 / 0 ms (+ 4.1 ms in 2 steps since start of marking, biggest step 3.0 ms) [last resort gc].
App 31178 stdout: 11295754 ms: Mark-sweep 1396.9 (1458.1) -> 1396.8 (1458.1) MB, 1071.1 / 0 ms [last resort gc].
App 31178 stdout:
App 31178 stdout:
App 31178 stdout: <--- JS stacktrace --->
App 31178 stdout:
App 31178 stdout: ==== JS stack trace =========================================
App 31178 stdout:
App 31178 stdout: Security context: 0x1b07beae3ac1 <JS Object>
App 31178 stdout: 1: new constructor(aka MongooseDocumentArray) [/var/www/****/code/node_modules/mongoose/lib/types/documentarray.js:~23] [pc=0x32b101f3b00b] (this=0x1fe592fffc09 <a MongooseDocumentArray with map 0x7832d03a399>,values=0x1fe592fffbe9 <JS Array[0]>,path=0x1fe592ff2761 <String[11]: oldpricearr>,doc=0x1fe592fffb91 <a model with map 0x7832d0386b9>)
App 31178 stdout: 3: /* anonymous */ [/var/www/****/code/nod...
App 31178 stdout:
[ 2016-02-13 16:59:37.0099 31143/7f907f278700 age/Cor/App/Poo/AnalyticsCollection.cpp:105 ]: Process (pid=31178, group=/var/www/****/code/public) no longer exists! Detaching it from the pool.
[ 2016-02-13 16:59:37.0100 31143/7f907f278700 age/Cor/CoreMain.cpp:794 ]: Checking whether to disconnect long-running connections for process 31178, application /var/www/****/code/public
此键<String[11]: oldpricearr>
是一个数组:
[{price: 5445, date: isodate},{price: 5468, date: isodate},{price: 45121, date: isodate},{price: 4785 date: isodate}, ect..];
此文档是否已损坏?或者这个docs中的数组对于推送新元素来说太大了? 如何找到问题?