title: nodejs FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
body: <p>Sometimes occur this error.</p>
  
  <pre><code>&lt;--- Last few GCs ---&gt;                                                                                                                                                                                                          
   [2856:00000253F09D3B90] 11688472 ms: Mark-sweep 1529.8 (1619.4) -&gt; 1529.7 (1583.4) MB, 1835.6 / 0.0 ms  last resort GC in old space requested  
  
   [2856:00000253F09D3B90] 11690272 ms: Mark-sweep 1529.7 (1583.4) -&gt; 1529.7 (1579.4) MB, 1799.7 / 0.0 ms  last resort GC in old space requested                                                                                                                                                                                                                                                                                                                   
  
  &lt;--- JS stacktrace ---&gt;                                                                                                                                                                                                         
  ==== JS stack trace =========================================                                                                                                                                                                   
  Security context: 000001F6C9E25739 &lt;JSObject&gt;                                                                       
  1: completeMany [C:\Users\mobasher.fasihy\Documents\GitHub\jobsaf-server\node_modules\mongoose\lib\query.js:~1459] [pc=0000006F3C3482B8](this=0000029E4B604F01 &lt;JSGlobal Object&gt;,model=00000090CCBE6729 &lt;JSFunction model (sfi = 000001A244DDB931)&gt;,docs=0000025B74FA8591 
  &lt;JSArray[53714]&gt;,fields=0000025B74FA8FF1 &lt;Object map = 00000207F58823B9&gt;,userProvidedFields=0000025B74FA9029 &lt;Object map = 000...                                                                                                                                                                 
  FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory                               
  1: node::DecodeWrite                                                                                            
  2: node_module_register                                                                                         
  3: v8::internal::FatalProcessOutOfMemory                                                                        
  4: v8::internal::FatalProcessOutOfMemory                                                                        
  5: v8::internal::Factory::NewUninitializedFixedArray                                                            
  6: v8::internal::WasmDebugInfo::SetupForTesting                                                                 
  7: v8::internal::interpreter::BytecodeArrayRandomIterator::UpdateOffsetFromIndex                                
  8: 0000006F3C2043C1                                                                                            
  [nodemon] app crashed - waiting for file changes before starting... 
  </code></pre>
  
  <p>Randomly above error occur on the server, and app crashes.</p>