I have been working on my game as usual, however last night I noticed massive lag spikes and I noticed that the client memory was very high. I reverted to an old version and the lag is mostly gone, however the client memory usage is still really high and it is the FPS is significantly low on mobile devices (I tried it on my iPad).
I have no idea how to reduce it and I’m not entirely sure what causes it, I’m aware that it’s client side, so I’m guessing server scripts wouldn’t affect it?
So far I’ve tried setting the collision fidelity for all the MeshParts to Box and it hasn’t done a lot.
I’m aware that while loops can cause memory leaks, but I’m not sure how.
Thank you!
EDIT: I’ve also tried disabling all LocalScripts in the game, so would that mean they’re not part of the issue, and that the issue has something to do with geometry?
Last time I checked, it occurs on a published place, but I will check right now to see if anything has changed. By high script activity, do you mean server scripts? Also, the script activity that has the highest % is the one that controls NPCs, and it usually runs at about 0 - 0.4%
My game doesn’t have a lot of decals, it relies mostly on Roblox textures, however there is a server script which runs through the workspace’s descendants (only one time, when the server starts) and runs certain functions based on their name e.g. if one is a door - and there are a lot of parts in the workspace - about 30,000, so that might be an issue.
And last but not least, I believe I am using a deprecated function in my guns (workspace:FindPartOnRay) so I will consider changing that if it would help lower the memory usage.
Thanks for your reply!
Okay, I’ve tried replacing the use of the deprecated function and it doesn’t seem to have done anything. I also downloaded a copy of the game and removed all scripts from it. When I ran it the client memory usage was at about 1700MB, so surely this means that the scripts were only taking up 100-200MB usage? (which is optimal). So I am really unsure as to what could be causing this at this point. My only last clue as to what could be causing the 1700-1900MB of client memory usage is that I have a few dummies around the map (they are not part of the game), so their Humanoids might be causing some lag. If that’s not the problem I’m not sure what it is.
Ok, I figured it out, there were a bunch of things (mostly concept ideas) outside the map that weren’t being used, so I took a world download, then deleted them on the published version and it has significantly reduced lag - thank you to everyone who has contributed though!