Extreme client memory usage

I really have no idea where to start from and what should I do, my game has a client memory usage of 1.9GB, even streaming enabled is on.

I have no idea what I should do because all unnecessary collisions were turned off alraedy since a while ago, even unnecessary textures were removed. I am also pretty sure the game has no memory leaks because that memory usage is the starter it didn’t grow slowly which means it is not because of a memory leak, therefore the issue in my map but I have no idea where exactly. also my map has over 77k part

3 Likes

maybe its cause ur map has over 77k parts, are these parts moving? do u have heavy scripts?

90% of the parts are not moving and anchored, Idk how do I check how many scripts are taking?

1.9GB sounds normal to me, especially since it sounds like you got a large map.

1 Like

I had a similar map before but the maximum was 1.4GB, although I am trying to decrease to make it mobile friendly

The mobile players in my game joins for like 2-3 minutes and leave directly without a return and it seems they are extremely lagging that is why I am trying to decrease it

Isn’t it compressed for mobile devices automatically? Personally, I have a strange way it works, that is, sometimes the game uses 2.3+ gigabytes of RAM, and sometimes 1.2 gigabytes, although the gameplay is the same and there is no difference in the picture (This is me on the PC) On phones, usually if there is not enough RAM, it compresses the textures and everything else and becomes playable (But it’s everyone’s individual already, personally I have so).

1 Like

Have you tried checking what is taking up the memory? There is a pretty detailed breakdown in the Developer Console.

image
You mean those?

I have no idea as I never played roblox with mobile tbh.

Yeah, there are a lot of them which can detail exactly where the memory is being used up. Look for any that say they are consuming hundreds of MBs of memory.

1 Like

As others stated its due to parts therefore one fix is optimization scripts which basically load and unload things depending on distance and if or not they are in sight of the player.

1 Like

I don’t know anything about optimizing scripts, there is one thing that possibly true which is trying to avoid long lines and shorten them

like this

local dad = script.Parent
local GrandFather = dad.Parent
local GreatGreatFather = GrandFather.Parent

instead of this

local GreatGreatFather = script.Parent.Parent.Parent

But to be honest I am not sure yet if this is a correct method or not

Roblox is pushing tons of useless features that increase memory usage, even a baseplate is over 1 Gb, you can’t do anything about it.

2 Likes

What in the world, a baseplate is just 1GB?

This looks normal. I just tested a game of mine and it had over 3 GB. I would only be concerned if it lags or has lag spikes for your self (Depending what pc you have other players should have something similar to play).

1 Like

Nope thats not what I mean. Optimization scripts basically loop through everything in workspace and then depending on their distance from character turn them invisible or visible which is just like loading and unloading. Example:

local Player = game.Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()
local function Load_Unload()
    for _,object in pairs(workspace:GetDescendents()) do
        if object:IsA("BasePart") then
            object.Transparency = Player:DistanceFromCharacter(object.Position) > 100 and 1 or 0
        end
    end
end

Then just place said function in a loop like say Runservice.

Please note this is just an example.

Isn’t that what streaming enabled do though?

Ohhhh yeaaaaa that exists… smh me… haha you can probably just lower its value down so it unloads object that are just a bit too far.

Turn them into meshes if you can