What client memory usage should I shoot for and how to reduce it?

I’ve recently looked into memory and noticed that in Studio it seems to be 758MB when I run my game:

I’ve also noticed that there is an “untrackedMemory” section which makes me think I might have a memory leak somewhere.

So I wanted to ask you all what your client’s memory usage is presently at in your games, and what could spike the client’s memory usage. How much client memory usage is “high”? What could be done to reduce it?

12 Likes

Most popular front-page games do their best to shoot for ~400Mb. This is because they want mobile players to be able to play the game as well, and the less memory you have, the better performance the game will take on all platforms for every player (with exception to a player’s internet connectivity).

A few things that I know that can spike the client’s memory usage are things like code optimization, building, textures, etc. I’d recommend making sure you’re code is as optimized as can be and to definitely avoid using too many textures.

9 Likes

You might also want to test memory in live servers (and preferably on the target device you are interested in) and not in Studio to get accurate measurements of memory usage.

6 Likes

So memory usage affects mobile users? Would changing materials in the world to SmoothPlastic help reduce memory?

Also would a lot of particles affect memory as well? (Beams, Fire and other effects)

2 Likes

Don’t think so. Materials shouldn’t impact memory as they’re to do with rendering (ditto particles).

Memory is about stuff like script variables (e.g. local x = 10)

1 Like

So basically to improve performance just reference less variables?

EDIT: Would setting a variable to nil work?

1 Like

What you really should do is be mindful of memory usage. Don’t treat variables and connections like a limitless resource. Clean up connections and variables when they are no-longer required, don’t just assume that Lua will remove them for you.

1 Like

It’s probably ill-advised to suggest that someone start saving memory by looking at script memory usage when you aren’t familiar with their project. Most of the time, script usage will not be a memory bottleneck on Roblox games.

@Mystifine I would start looking at the memory values for geometry. Double-check that you aren’t using any meshes with a polycount much higher than they realistically need to be, check that you aren’t using a high collision fidelity on objects where you don’t really care about precise collision / collision at all, check that you are using terrain efficiently, check that textures you are using are not oversized, try to reuse textures/meshes rather than having a ton of unique assets, etc. This will save much more memory much quicker than cleaning up your scripts.

38 Likes