Description
- Node: v7.5.0
- Kernel info: Linux beck 4.4.0-62-generic Improving code readability on lib/_http_agent.js #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
- Ubuntu 14.04 inside Docker Container
<--- Last few GCs --->
174442 ms: Mark-sweep 1296.4 (1410.1) -> 1296.2 (1417.1) MB, 1277.8 / 0.0 ms [allocation failure] [GC in old space requested].
175737 ms: Mark-sweep 1296.2 (1417.1) -> 1298.1 (1417.1) MB, 1294.3 / 0.0 ms [allocation failure] [GC in old space requested].
177043 ms: Mark-sweep 1298.1 (1417.1) -> 1304.4 (1410.1) MB, 1305.8 / 0.0 ms [last resort gc].
178394 ms: Mark-sweep 1304.4 (1410.1) -> 1310.7 (1410.1) MB, 1351.3 / 0.0 ms [last resort gc].
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0xe4ac4fcfb51
5: get nodeName [/var/local/bot/node_modules/jsdom/lib/jsdom/living/nodes/Node-impl.js:~111] [pc=0x2c58704c2f92] (this=0x654cb5d31f9 <an EventTargetImpl with map 0x3ad8b147ed29>)
9: _attach [/var/local/bot/node_modules/jsdom/lib/jsdom/living/nodes/Element-impl.js:~102] [pc=0x2c58705cc055] (this=0x654cb5d31f9 <an EventTargetImpl with map 0x3ad8b147ed29>)
10: _attach [/var/local/bot/nod...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [/usr/bin/node]
2: 0x10b084c [/usr/bin/node]
3: v8::Utils::ReportApiFailure(char const*, char const*) [/usr/bin/node]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/bin/node]
5: v8::internal::Factory::NewOneByteInternalizedString(v8::internal::Vector, unsigned int) [/usr/bin/node]
6: v8::internal::AstRawStringInternalizationKey::AsHandle(v8::internal::Isolate*) [/usr/bin/node]
7: v8::internal::StringTable::LookupKey(v8::internal::Isolate*, v8::internal::HashTableKey*) [/usr/bin/node]
8: v8::internal::AstRawString::Internalize(v8::internal::Isolate*) [/usr/bin/node]
9: v8::internal::AstValueFactory::Internalize(v8::internal::Isolate*) [/usr/bin/node]
10: v8::internal::Parser::Internalize(v8::internal::Isolate*, v8::internal::Handlev8::internal::Script, bool) [/usr/bin/node]
11: v8::internal::Parser::Parse(v8::internal::ParseInfo*) [/usr/bin/node]
12: v8::internal::Parser::ParseStatic(v8::internal::ParseInfo*) [/usr/bin/node]
13: 0xb5473e [/usr/bin/node]
14: 0xb5c106 [/usr/bin/node]
15: v8::internal::Compiler::Compile(v8::internal::Handlev8::internal::JSFunction, v8::internal::Compiler::ClearExceptionFlag) [/usr/bin/node]
16: v8::internal::Runtime_CompileLazy(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/bin/node]
17: 0x2c586d9092a7
Aborted (core dumped)
Is there are some mechanisms to protect node.js runtime from out of memory?
As i understand, there can be problems with setInterval and active references. Garbage collector doesn't delete them as i remember. Data is not collected if there at least one reference to them as i remember.
Or it's up to coders to control how much memory left and avoid going over overall memory?
Is there some aggressive garbage collection features implemented in node.js for such critical "out of memory" situations?