Fixed server memory leaks#2097
Open
APERUTRE wants to merge 4 commits intoEpix-Incorporated:masterfrom
Open
Conversation
## Changes - Fix player connection cleanup in `Process.luau` - Cancel player load timeout tasks on leave - Clear `Remote.Clients[key]` on player removal - Fixed client folder staying referenced in server memory ## Why These changes prevent memory leaks which could impact the server on long uptime ## Testing Tested in Roblox Studio with multiple players joining and leaving. Confirmed that: - player specific connections are disconnected on leave - delayed load timeout tasks are canceled on leave - `Remote.Clients[key]` is removed on leave - client folder doesn't stay referenced after player leaves
wilsontulus
reviewed
Apr 7, 2026
Comment on lines
+905
to
+907
| if Remote.Clients[key] then | ||
| Remote.Clients[key] = nil | ||
| end |
Contributor
There was a problem hiding this comment.
I think the Remote.Clients[key] should only be dereferenced after a 1 second delay and it's confirmed that no player with the aformentioned UserId is in the server again (in case of quick re-join).
task.delay(1, function()
if not service.Players:GetPlayerByUserId(p.UserId) then
Core.PlayerData[key] = nil
-- move the Remote.Clients[key]=nil here instead?
Author
There was a problem hiding this comment.
yea i think that would be better
wilsontulus
reviewed
Apr 17, 2026
Co-authored-by: Wilson Simanjuntak <wilsontulus5@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Process.luauRemote.Clients[key]on player removalWhy
These changes prevent memory leaks on server which could impact the server on long uptime
Note
i made a pull before this one but i fucked something up and didn't see it
Testing
Tested in Roblox Studio with multiple players joining and leaving. Confirmed that:
Remote.Clients[key]is removed on leaveProof
before


after