Describe your issue here.
x in one of the [ ])x in each of the [ ])Filling out the following details about bugs will help us solve your issue sooner.
@slack/client version: 4.2.2
node version: 8.7.0
npm version: 5.6.0
OS version(s): macOS High Sierra 10.13.4
const web = new WebClient(
'<TOKEN>',
{
maxRequestConcurrency: 10,
logLevel: 'debug',
logger: (level, message) => {
logger.info(message);
}
}
);
web
.channels
.list({
exclude_members: true,
exclude_archived: true,
limit: 10
})
.then(res => {
console.log('channels', res.channels);
})
.catch(error => {
console.error('Error: ', error);
});
Below are the logs which gets generated.
@slack/client:WebClient "initialized"
@slack/client:WebClient "apiCall() start"
@slack/client:WebClient "request attempt"
<--- Last few GCs --->
[94028:0x102802600] 36734 ms: Mark-sweep 1404.7 (1461.3) -> 1404.6 (1438.3) MB, 2855.6 / 0.0 ms (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 2856 ms) last resort GC in old space requested
[94028:0x102802600] 39417 ms: Mark-sweep 1404.6 (1438.3) -> 1404.6 (1438.3) MB, 2682.6 / 0.0 ms last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x1245d08a5e71 <JSObject>
1: /* anonymous */ [_stream_writable.js:~264] [pc=0x2f45b35f3b4b](this=0x124507803001 <Transform map = 0x1245d1de4021>,chunk=0x124507803019 <Uint8Array map = 0x1245dadc1a21>,encoding=0x1245aad82311 <undefined>,cb=0x1245aad82311 <undefined>)
2: arguments adaptor frame: 1->3
3: ondata [_stream_readable.js:~637] [pc=0x2f45b363c74c](this=0x124507803349 <IncomingMessage map = 0x1245d1de62...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [~/.nvm/versions/node/v8.7.0/bin/node]
2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [~/.nvm/versions/node/v8.7.0/bin/node]
3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [~/.nvm/versions/node/v8.7.0/bin/node]
4: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) ~/.nvm/versions/node/v8.7.0/bin/node]
5: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [~/.nvm/versions/node/v8.7.0/bin/node]
6: 0x2f45b348463d
and then app crashes.
Expected to return list of channels
Crashed node app
hi @krishna-koushik, sorry about the difficulties. so, we're dealing with an out of memory situation. is there any other code in this program that could cause memory usage to spike? was there a version of this package that did not cause the memory to spike in this app (a last known good state)? it seems highly unlikely to me that a simple call to channels.list would take over 1 GB of memory. i'm going to run a test myself to see if i can figure out what the expected memory use for a simple call like this should be.
as far as i can tell (and i am fairly novice in memory debugging), i ran the same program and saw about 482k worth of allocations, and they seem to all be reclaimed by the GC. i also ran on the same version of node (8.7.0).
Also, from what I can see on the Slack's document page, I'd rather not use channels.list API anymore, but conversations.list instead.
Don't use this method. Use conversations.list instead.
Closing this issue due to inactivity
Most helpful comment
Also, from what I can see on the Slack's document page, I'd rather not use
channels.listAPI anymore, butconversations.listinstead.