Tips for Memory usage

Hello!
Looking for some advice on reducing the memory usage in my game.
On my desktop it runs around 600-615MB, without any lag, but on my mobile device, it spikes up to over 1000MB and crashes.

It currently has:
Parts: 7,353
Voxels: 104,674
Instances: 31,702

About 13,000 Instances and 5,900 parts come from the various Workspace things. A large chunk of instances come from Int/String Values from enemy data inside the ServerStorage.

I have three GUIs inside the StarterGui, whenever I need new frames, I clone them in from ReplicatedStorage or ServerStorage depending on what it is, and its Destroyed afterwards.

The only Loop script running is a day/night system, and a water fountain script, that I think I’ll replace with a static mesh. Every part is anchored down. There are very few parts with transparency. I use meshes where I can to keep the part count low. Everything that can be made into Box/Hull already is. There are a fair amount of NPCs, all sharing three MeshIDs, but they have unique textures in a lot of cases. As seen in this screenshot the world map is large-ish:

I’m considering splitting the map into multiple Places to reduce the Parts/Instances count down, but I’m hesitant to annoy players with having to load up a new Place every time they leave the area for a new one. However, I did notice much better mobile performance when I split the world into two halves. But there was still a bit of lag on my device - my phone model is a LG K51. Would the trade off for multiple places for better performance be worth the potential frustration?

Link to the test version: ScribeOfTheEndless's Place Number: 4 - Roblox

(Please disregard the opening intro, it still needs work and is a placeholder for now, and don’t purchase Coins.)

I don’t suppose anyone has a plugin that determines which Parts take up the most size/memory? I didn’t find one while searching recently.

Any advice is much appreciated. Thank you!:slight_smile:

2 Likes

Played the game and walked around a bit. Your place memory for graphics textures is rather extreme, reading about 1200 on my end. Give it a test where you remove textures and see if that number is reduced and helps crashing. If it does, then slowly add back in textures and test periodically and see what your limit is. Can’t really see anything else inherently wrong aside from that on the client’s end.

3 Likes

Thanks for checking! I see the 1200 MB usage too, and that is so weird. The AssetID files for the textures are 5MB each, yet the actual image file on my computer is a few KBs. O.o How is this possible?