How can i decrease memory usage?

So I’m trying to make a game like SCP 3008 and my map generation system is kinda the same.
My rooms doesn’t have as complex models as them.

Now their game has about 800mb - 1000mb Memory usage and my game has about 2000mb - 2500mb.
Our map size is the exact same (exact same number of rooms). Now i have tried streaming enabled but it doesnt help at all.

If anyone got a idea how to lower the memory usage please tell me.
I will happily reply with scripts incase you want to view them just ask.

The reason I don’t have any scripts included for now is that I don’t know or got any idea what’s causing it.

Actually i think thats a quite high.

Take a look to this thread.


Thanks ill check it out ill reply if i get any problem

1 Like

Aint helping to much mostly mentions what I’ve tried. And id use streaming enabled if i could but it doesn’t work. Or well it does work it just renders very slowly in my game making it look weird for the first 5 minutes of playing.

Maybe the issue is the map generation system. Try to improve/rework the system.

Is it steadily increasing? Could be a script memory leak.

Is the memory usage you stated in Studio or the Roblox Player Client?

I’ve noticed 1330mb memory in studio and only 200mb in the client.

If it’s in the client, try using StreamingEnabled and change simple things in your scripts (for example, changing most waits to task.wait).

Well after the 2000 point it increases with like .5 each sec

Its in roblox. Also streaming enabled makes my game load so slow i really don’t know why. It will render all the parts just really slow. Im thinking of a work around tho right now.

How does your map generator generate a map? Part by part or using other techniques?

So i have a folder with all the spawn points and i use a In pairs loop to go thru them all and place a map. I also have a .heartbeat:wait() So there script dont take to much performance.

Also I have now tried using streamingEnabled again and it actually Takes 1GB of memory off and it really helps the FPS. now I got 1 problem left tho. StreamingEnabled doesn’t work. Let me explain

I join the game and it all renders fast and properly using streamingenabled. I walk thru the entire map and everything works right. Now on my walk back a lot of parts will be missing because of streamingenabled not Re rendering them. Heres a picture:

If you got any idea why StreamingEnabled might be doing this please help (Also this isn’t Slow rendering its a completely stopped render).

Does the loop stop once the map is loaded entirely?

Yes, Also the problem to solving the Memory Thing is StreamingEnabled. But as you can see on the picture above it doesn’t work properly.

But yes the loop stops and the script will not run agian.

Use microprofiler as @TheDestroyer0525 showed you the thread.

1 Like

What does it do tho? Like can it fix streamingenabled?

1 Like

You will be able to know what and why does it take alot of memory using microprofiler.

Well I know why now. Its because of all the parts. But streaming Enabled fixes that. Before when I made this post my game used 2GB memory. I now enabled Streaming and it only uses a static 1GB. Only problem now is that the streaming enabled doesn’t work.

Unfortunately I don’t know why that does happen but you should read this.
https://developer.roblox.com/en-us/articles/content-streaming

Yeah have done that it isnt really to much help about it. Im considering contacting roblox support about it.

Can you show the hierarchy of a model like a lamp or any instances that despawn after returning to that certain point?