My game has some memory issues as it consumes about 1 GB client memory. I’m not sure what is hogging up all of the memory but I suspect it might just be world rendering. Do you guys have any tips on how to reduce memory consumption? For reference, Jailbreak uses about 800 MB of client memory and my game is nowhere near as big as Jailbreak, still Idk why so much memory is beihg consumed.
You need to see what kind of scripts you have, Answer these questions:
How big are your scripts?
How many remotes do you use?
How many global variables or global functions do you have?
How many scripts do you have?
Are there connections that you dont need anymore that you dont get rid of?
Are there variables and tables that you dont need anymore but you still use it?
How many meshes/unions are there?
On average is the memory consumption rate of remote events high?
It really depinds, if there are lots of remotes then it can have a weight on your memory usage.
If this is the problem then you should try doing the maximum you can to use only the server. When it is unavoidable you use the remotes.
I’ve heard of destorying connections, but Idk how and does it help with memory usage?
I took a lot of textures that were originally large(500x-1024x) and shrunk them down to their smallest reasonable size(sometimes as low as 10x10)
I dropped hundreds of MB from memory doing this.
You should post a pic of your client’s memory usage. Youll get a better idea of where the memory is going to.
Yes it helps, but you should only destroy connections when it is indeed not needed anymore.
Using a example:
Let’s say there are players in a round and if any of them die then they are removed of it, so to be sure they die you use either Humanoid.Died or Player.CharacterRemoving
But you only want to remove them from the round when they are inside, so you disconnect it when the player dies or removes character.
Doing this will prevent using memory for no reason and prevents the player of not being able to be in the next round if they die meanwhile intermission.
This should help you if your problem in memory usage is at script: