Extremely High RAM Usage (Over 1 GB!)

Hello,

Take a look at the below screenshot:

At the top, you can see the performance statistics. Ping, CPU usage, and GPU usage are extremely slow. On the contrary, memory usage is at over 1K MB (when the target is 200MB or under). This is causing huge problems for users who have a low amount of RAM, most commonly those on mobile devices or Macbooks.


Here is what I know:

  • It cannot possibly be the map or any graphics, considering that A.) GPU blueprint is so, so low, and B.) I have spent the time to completely optimize the entire map and UI.

  • It cannot be from loops or other timed events, as the CPU usage is also fairly low, maybe everage. It could be better but is not the problem.

  • It’s likely to be a memory leak, albeit I cannot tell how that could possibly happen.


If anybody has any ideas, that would super helpful!
You can find the game with the issue here.

7 Likes

Have you looked at the detailed memory breakdown in the dev console?

1 Like

A bit, although I’m no expert with it.
This is what I see:

Is there anything that stands out?

2 Likes

Maybe you are using too many while loops/other loops. Each loop runs 30 or more Hertz. The more loops the more memory it uses.

3 Likes

I find that unlikely. If I were to use many loops, the CPU usage would be high instead.

6 Likes

Do you have a source for this? I’ve unfortunately had the “pleasure” to work on games that were poorly optimized and had a lot of repetitive loops, and while they did affect performance substantially, they never caused a spike in RAM usage. I’m pretty sure this would just affect CPU usage and not so much the GPU.

Is your codebase modular or are you just using a bunch of scripts? This doesn’t really mean anything but I’m wondering if you’re able to create a new version of the game with certain scripts disabled to see what could be causing memory spikes.

3 Likes

GraphicsTexture is using a bit too much ram, soo textures?

3 Likes

134MB isn’t necessarily an excessive amount of memory being allocated for textures.

1 Like

I also have over 1 gigabyte, however my game doesn’t lag and I’ve never thought much of it. Is this abnormal?

2 Likes

This article has more information on what each memory category is. For comparison, here’s what I see on a default baseplate.

I think your LuaHeap might be abnormally high. I’m seeing about ~23MB on Adopt Me.

3 Likes

1GB doesn’t sound bad at all and sounds like Roblox is making use of memory for you.

image

A shot from one of my places.

Similarly to how Windows 10 will make use of as much RAM as it can, Roblox will most likely try to do the same to deliver the best experience possible.

4 Likes

RAM Usage is a lot higher in studio than in the actual game

4 Likes

I didn’t have too big an issue in the game:

It’s still large however it could be worse.

It does seem memory is getting larger and larger however. Here is my Client logs:

There are a few errors there. Hopefully that can help you track down this issue.

2 Likes

Since it’s increasing I wonder if that’s a cache issue. Maybe he’s over caching stuff. Like having a giant table or something;

2 Likes

The code is mainly modular. There were times where my code got lazy and I made a script instead, but for the most part, just modules.

The description to fix it is “Write memory-efficient scripts.” The question is, what are my scripts using such a large amount of memory?

There are a few large tables, yes.

1GB is terrible. The target is 200MB if I want mobile and low-end computer users to have a lag-free experience.

1 Like

I don’t think you read what I said or maybe you misunderstood it.

Roblox will not use 1GB of RAM on a mobile device. Again, 1GB is not terrible because it is for the device you are currently using. Once again, just like Windows 10 - Roblox will properly adjust to the available RAM to provide the best experience. You do not need to worry about these trivial things until it’s an actual problem. Which, so far, it is not.

Allowing Roblox to utilize RAM

vs Restricting it (mobile devices)

Roblox deals with this for you.

9 Likes

Alright, that’s fair. Albeit, the RAM usage is still very high.

For me, RAM use after maybe 30 minutes playing, its alright. 600 - 700 MBs. Which is fine. And completely normal, another thing, the more ram you have the more your programs will start to use, if you have like 8 gb of ram, and you open chrome, it’ll use alot more.

3 Likes

Based on what? I’m confused why you keep saying that. A new baseplate has around 800MB-1GB because that is normal for your machine. So no “albeit the RAM usage” is not high. Maybe in 2010…?

2 Likes

I base it on two metrics:

  • One, Roblox’s 200MB metric is seen in the performance stats. If you click “Memory” and look to the right, you will see a dashed line representing that target.

  • Two, read the original post. A majority of mobile players and macbook users have a really hard time playing the game, some logs reporting an FPS as low as 1-2 FPS. This has been causing a significant decrease in players as the RAM usage has been getting worse over time (for example, playercount is about 20-50 now, versus the 3K months ago, which comprised mostly of mobile players).

I am not looking to compare my RAM usage to others. I made this post to ask what potential causes are, and what could be done to reduce it.

Here are some example reports that back my claim that it’s an issue:
image
image
image
image
image
image

In fact, I could never get all those reports.

image

Also, note the impact on the game by seeing the average playtime for mobile users:

Infinite Autocorrect is the only project I have with such an issue.

2 Likes