reservedSeatTimeouts Memory Leak
See original GitHub issueWe encountered a suspecious memory leak when using this framework, the reservedSeatTimeouts
of Room
seems not release in some unkown reasons. The cpu% will grow slowly from 1 to much higher. We inspected the heap dump and found the reservedSeatTimeouts
of room stored so many Timeout
instances. See below screenshot:
It seems in this function the
this.reservedSeatTimeouts
should delete the reservedSeatTimeout
(delete this.reservedSeatTimeouts[sessionId]
) when seats reservaltion expired.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How does setTimeout() create a memory leak in this code?
This is technically a memory leak because there is no longer any direct reference to the setTimeout function so that you could clear...
Read more >How can Forgotten timers or callbacks cause memory leaks in ...
When any object is tied to a timer callback, it will not be released until the timeout happens. In this scenario timer resets...
Read more >JavaScript: setTimeout Memory Leak Prevention. - gists · GitHub
JavaScript: setTimeout Memory Leak Prevention. GitHub. Instantly share code, notes, and snippets.
Read more >4 Types of Memory Leaks in JavaScript and How to Get Rid Of ...
In this article we will explore common types of memory leaks in client-side JavaScript code. We will also learn how to use the...
Read more >setTimeout, closures, and IE memory leak help [Archive]
Hi: I'm trying to understand how to resolve an IE memory leak that occurs in the following general situation. Basically, if I use...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi guys, on version
0.11.25
I’ve pushed this change, which may fix the memory leak: https://github.com/colyseus/colyseus/commit/49f1c9641411c09a4c26489f7a0bb85950baba5eRegarding the rooms not being disposed, I do have the same issue on production for some projects, and I don’t know exactly the reason yet. It never happens locally, so it’s difficult to reproduce and find how to fix. The
@colyseus/monitor
often displays one room with0
clients, and when I click on “inspect”, there is one stale client in there.Closing as the original issue seems to have been resolved!