Reduce memory usage ideas

So my game is using more than 1500 mb on studio, it goes down to 1100 ingame but its still a lot,. I checked all my scripts and removed some things that maked the memory go from 2000 mb to only 1500 mb, but its still a lot of ram, any ideas to lower it?

1 Like

depending on your game, 1500 is somewhat average; if you are reaching the end of beginning development of your game, this should be normal. on mobile devices, this should significantly be lower automatically, like around 900 MB.

just make sure your disconnecting connections, cleaning up unused variables and values, and check luaheap in the dev console for more info

(ps. please change your script context in that output message to legacy in your startergui. offtopic, and unlikely, but could also be a factor)

and i dont know what that warning message means, i cant find the script

Wait do connections get removed when the script destroys?

Yes.

505050505050505050505050 characters

oh cool, how can i get rid of that warning message? it may be the cause

YOu have a script in starergui. Only local scripts are supposed to be there. Just google “legacy run context roblox” --if you want to put a normal script there you have to give it a “legacy” run context instead of the defualt which is “server”. You are correct that it could be causing memory leak.

There i got rid of it, i managed to get rid of like 90 mb, idk if i can go any lower

Have you turned on streaming enabled? Are you using voxel lighting? Have you checked microprofiler?

no i dont know what those things are i will check