My players and I have encountered a very annoying bug that has likely been the culprit for dwindling players in the Matchmaking portion of my game.
When teleporting from the starting place to the Matchmaking place in particular, the game tends to “freeze” and take AGES (or sometimes never) to actually load. This comes in the form of a solid black screen due to a “fade to black” script I have.
This tends to only occur in Public servers that have been active for quite some time, and not private servers (private servers tend to be instant when teleporting between places).
While this bug is occurring, the CoreGui’s are completely absent, and the cursor disappears (as shown in the video). I believe it just takes the last frame before the freeze and sticks to it.
Although it is difficult to determine exactly what is causing your game to freeze, it could be an issue with memory leaks. If your game’s code contains memory leaks, which build up over time, it slowly degrades the performance of your game. If this is the case, it could explain why a new server with just you in it had a significantly better performance than a public server with multiple people in it that had been running for hours. However, there is a possibility something else could be causing this problem; memory leaks are only one thing to consider and there is a possibility that this is not the reason why your game is freezing.
The first thing I would recommend in order to pinpoint the issue is accessing the performance statistics in the developer console (accessible by pressing F9) and comparing the statistics between a private server and some public servers, especially those that had been running for a long time. In addition, keep note if any performance stats heavily change while you use the matchmaking system, and if these performance stats change significantly more in a public server than a private server.
Also, has this performance issue always occurred? Was the matchmaking system recently reworked, or has the performance of your matchmaking system remained the same for a long time until recently? This information will make it easier to pinpoint the cause behind this issue.
I have found the issue to be caused by a memory leak resulting from ObjectValues never being added to Debris in my Sound Scripts.
Thank you Friendly4Crafter for guiding me to memory leaks as the root cause (marked their post as the solution), as I’d likely never found this if this reply wasn’t made.
I found the ObjectValues from a code snippet that counted the number of Instances occupying Memory based on ClassName. Object Values tended to be the majority of all instances in old servers.