Memory Leak Help? (What is "render/system"?)

In my game the CoreMemory seems to continuously go up. There are occasional drops from when I watched it, but there is an overall increase as time passes by. I determined the render/system memory was the one constantly going up (Started at around 30 mb and about 15 min later it was about 180 mb).


I honestly have no idea how to solve this as I don’t know exactly what render/system is meant to describe or what I’m doing that is causing this. Any suggestions or advice for this would be appreciated.

** EDIT
doesn’t seem to have anything to do with scripting as I’ve disabled all scripts in my game on server and client, so I think it’s something on roblox’s end or maybe a plugin I have but idk what a plugin could be doing

v this was after about 30 minutes with all scripts disabled

5 Likes

Usually this happens when a script is creating RBXScriptConnections indefinitely.

I have an example of really bad case that happened to me a few months back. In August, Roblox pushed an update that made Motor6D properties not replicate from client to server, and so the classic animation script everyone used to emulate the character movements as they were in old Roblox, broke. While for you, your character animated fine, everyone else’s characters were just moving rigid bodies. I created a fix that locally simulated everyone else’s animations.

To do this, I created a RunService.RenderStepped connection for everyone’s character. I would disconnect this connection whenever they would respawn. However, inside the RenderStepped function was a stipulation that checked if some character variable was nil, and if it passed then it would re-establish the connection to the latest character. Problem was, it wasn’t disconnecting the old connection nor was it refreshing this character variable for the new connection, and so this double whammy of bad code caused it to create a new RBXScriptConnection on every render step. If this condition happened (which was rare), it would completely lag out your game in a very short timespan.

Here you can see the left screen’s output counts the number of connections made so far for each character. You can also see the Animate LocalScript taking upwards of 70% of the app’s memory.
https://gyazo.com/4532dd8d059f7828b1e4b3b8746cd287

So yeah, just make sure you properly handle your connections.

Can you confirm that you were seeing render/system go up though? I’ve tried to be pretty careful with handling connections and before I go and start trying to figure out where exactly I messed up it would be nice to know that for sure.

I can’t confirm that, but I will say that render/system appears to be a clientside only entry under the Memory tab, so that should eliminate any server-sided code from being the culprit. Moreover, the word ‘render’ itself being there tells us it’s clientside, as the server obviously doesn’t do any rendering.

Yea I’ve determined it’s something client side as well but I want to know what exactly render/system is supposed to mean so I can figure out what part of my code is messed up. (Will be extremely time consuming to figure this out without knowing what render/system means as there’s like 25k ish lines of code on the client or something)

Another way to narrow down what script is causing the memory leak is to disable each clientside script one by one, testing in game for a while between each time to see if the gradual increase in memory usage persists. If you disable a script, test in game, and the memory leak doesn’t occur, then you know that script was where the issue was occurring. Unfortunately this method may take a while.

well I disabled every client module and disabled the one script that handles all modules and it was still going up. I then disabled the SERVER script that handles all modules and render/system stopped going up (this was in studio, not sure if it would be different ingame but I assume it wouldn’t)

huh interesting I disable the server and client script and publish, and ingame, render/system still seems to go up for no reason. very random results

don’t think it’s related to scripts at all now, this was in a server after maybe ~30 minutes with all scripts disabled

i also joined some of my other places and render/system seemed to initially go up in those places too without going down (although I didn’t stay for as long, but after about 10 minutes it was only going up and never went down)

this issue is preventing me from releasing my game so any help would be nice, and if someone knows what render/system is referring to that would be good too

I think it’s either a malicious plugin I may have OR an issue on roblox’s end
render/system seems like it would refer to something lighting/rendering related so idk where to go from here

took forever to figure out,
for anyone else that has this issue: turn off Future lighting

I’m not familiar with the procedure to report a bug or anything, but I turned lighting from Future to ShadowMap and it seemed to have solved the issue (as far as I know).
Some longer testing will be required to ensure everything’s good but I stopped seeing constant increases when I turned it off.

How I determined this:
I tried moving everything to a separate place and I had no issues until I turned on Future Lighting. I disabled it in my original place and I stopped having the issue.

I assume it has something to do with the post processing effects I use in conjunction with Future lighting enabled or something but idk for sure. Kinda strange cause I’m pretty sure future isn’t even enabled in live games yet.

5 Likes

It is enabled in live games as of Monday I believe.