Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak! #41

Closed
adsr opened this issue Jun 8, 2018 · 3 comments
Closed

Memory leak! #41

adsr opened this issue Jun 8, 2018 · 3 comments

Comments

@adsr
Copy link
Owner

adsr commented Jun 8, 2018

After running for a week or so...

slack_in pong { type: 'pong', reply_to: 32384 }
slack_in pong { type: 'pong', reply_to: 32385 }
slack_in pong { type: 'pong', reply_to: 32386 }

<--- Last few GCs --->

[26634:0x3a2cae0] 195947049 ms: Mark-sweep 1617.4 (1795.4) -> 1617.4 (1795.4) MB, 1664.1 / 4.1 ms  allocation failure GC in old space requested
[26634:0x3a2cae0] 195949205 ms: Mark-sweep 1617.4 (1795.4) -> 1617.4 (1771.4) MB, 2154.7 / 7.2 ms  last resort GC in old space requested
[26634:0x3a2cae0] 195951478 ms: Mark-sweep 1617.4 (1771.4) -> 1617.4 (1750.9) MB, 2272.0 / 5.1 ms  last resort GC in old space requested


<--- JS stacktrace --->

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

Security context: 0x3a28520257c1 <JSObject>
    1: DoJoin(aka DoJoin) [native array.js:~94] [pc=0x2abbb0fda88b](this=0x2977c21822d1 <undefined>,o=0xc4d66e7eb11 <JSArray[104]>,p=104,D=0x2977c2182371 <true>,z=0x2977c2182431 <String[0]: >,y=0x2977c21823e1 <false>)
    2: Join(aka Join) [native array.js:~119] [pc=0x2abbb16969be](this=0x2977c21822d1 <undefined>,o=0xc4d66e7eb11 <JSArray[104]>,p=104,z=0x2977c2182431 <String[0]: >,y=0x2977c21823e...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [node]
 2: 0x11e7fec [node]
 3: v8::Utils::ReportOOMFailure(char const*, bool) [node]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
 5: v8::internal::Factory::NewRawOneByteString(int, v8::internal::PretenureFlag) [node]
 6: v8::internal::Runtime_StringBuilderConcat(int, v8::internal::Object**, v8::internal::Isolate*) [node]
 7: 0x2abbb0e842fd
@cbirkett
Copy link

I'm running into this issue every day or two, and it's a bit frustrating since it means I lose my logs from whenever it decided to crash until I manually restart it. Literally the only problem I've had; otherwise it was easy install and pretty much spotless implementation of the Slack IRC gateway.

slack_in pong { type: 'pong', reply_to: 14118 }
slack_in pong { type: 'pong', reply_to: 1349 }

<--- Last few GCs --->

[5710:0x103001000] 219311300 ms: Mark-sweep 1395.8 (1430.3) -> 1395.8 (1430.3) MB, 3992.1 / 15.7 ms  allocation failure GC in old space requested
[5710:0x103001000] 219316158 ms: Mark-sweep 1395.8 (1430.3) -> 1395.8 (1430.3) MB, 4848.9 / 6.8 ms  last resort GC in old space requested
[5710:0x103001000] 219318118 ms: Mark-sweep 1395.8 (1430.3) -> 1395.8 (1430.3) MB, 1959.6 / 7.1 ms  last resort GC in old space requested


<--- JS stacktrace --->

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

Security context: 0x13b3ec0a5879 <JSObject>
    1: set(this=0x13b391cc7b09 <Map map = 0x13b32a7048d9>,1454924,0x13b3d83a15b1 <JSArray[128]>)
    2: emitInitNative [internal/async_hooks.js:~128] [pc=0x186db59067b6](this=0x13b3d83a13e9 <PromiseWrap map = 0x13b379311929>,asyncId=1454924,type=0x13b3ec0a8779 <String[7]: PROMISE>,triggerAsyncId=1454910,resource=0x13b3d83a13e9 <PromiseWrap map = 0x13b379311929>)
    6: then(this=0x13b3d8396dd9 <...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/usr/local/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/usr/local/bin/node]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/node]
 4: v8::internal::Factory::NewFixedArray(int, v8::internal::PretenureFlag) [/usr/local/bin/node]
 5: v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Rehash(v8::internal::Handle<v8::internal::OrderedHashMap>, int) [/usr/local/bin/node]
 6: v8::internal::Runtime_MapGrow(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
 7: 0x186db56842fd
Abort trap: 6

@adsr
Copy link
Owner Author

adsr commented Jun 28, 2018

Thanks for the report @cbirkett. I suspect these are caused by

require('trace');
require('clarify');
Error.stackTraceLimit = 128;

which are there only for debugging / to get better stacktraces from async functions. I haven't encountered any memory errors since removing those. I will trunk that soon.

adsr added a commit that referenced this issue Jun 30, 2018
@adsr
Copy link
Owner Author

adsr commented Jun 30, 2018

I think d7c9269 will fix. Please re-open if you can repro after this commit.

@adsr adsr closed this as completed Jun 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants