Skip to content

Patched several memory leaks#17

Open
MythicPalette wants to merge 1 commit intoStreamerbot:mainfrom
MythicPalette:main
Open

Patched several memory leaks#17
MythicPalette wants to merge 1 commit intoStreamerbot:mainfrom
MythicPalette:main

Conversation

@MythicPalette
Copy link

I noticed abandoned listeners due to the following --warn-trace output:

(node:188671) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [WebSocket]. MaxListeners is 10. Use emitter.setMaxListeners() t
o increase limit
    at genericNodeError (node:internal/errors:985:15)
    at wrappedFn (node:internal/errors:539:14)
    at _addListener (node:events:582:17)
    at WebSocket.addListener (node:events:600:10)
    at WebSocket.addEventListener (node_modules/ws/lib/event-target.js:249:12)
    at withTimeout.timeout.timeout (node_modules/@streamerbot/client/dist/index.js:1079:20)
    at new Promise (<anonymous>)
    at StreamerbotClient.request (node_modules/@streamerbot/client/dist/index.js:1078:40)
    at StreamerbotClient.getUserGlobal (node_modules/@streamerbot/client/dist/index.js:1614:33)
    at F (apps/server/dist/server.js:1:7050)
  • note: I did modify the shown file paths as they contained my private file structure. The only modifications made were removing the path preceding node_modules

Searching node_modules/@streamerbot/client/dist/index.js, I located several instances where anonymous function listeners were being assigned to this.socket and then abandoned.

I do apologize, a couple lines in my code got hit by reformatting so that's why a few of the previously single lines are multiline now.

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

Successfully merging this pull request may close these issues.

1 participant