Rapidly increasing 'Default' and 'Physics step' memory

I was checking over the memory usage of my game and noticed that the core memory was constantly increasing, and found that ‘default’ and ‘physics step’ were increasing constantly. When I first noticed, default was around 160mb, and at the time of writing is now nearing 475mb.

Despite this, the overall client memory was only being reported as 180mb, despite CoreMemory reaching 1gb.

I mainly want to know if this is something I should be concerned about, whether it may have been caused by something I did, and if there is something I can do to prevent it.

1 Like

If you have a lot of stuff that uses physics all at once this may be causing it

Any update on this? I’m noticing the same thing and not sure about what it means. I do have a lot of physics in my game. How do I make the ‘default’ memory go down? It seems to only start happening on old servers (1-2 hours old).

1 Like

Hello, Codesense
My game had the same issue as yours, and I didn’t some research about it recently. I found two main reasons which can cause memory usage to keep increasing.

  1. Memory Leak from Gui
  2. Memory Leak from scripts

This article has some suggestions for both situations above.

And this article gave a good explanation of how codes cause a memory leak.

I am going to go through all the codes from my game and try to fix the issues. I will update my results here again if it works!

Good Luck!

Hi, Codesense

I found the problem which caused my game’s memory usage to keep increasing, and here is the update.

The two articles will definitely help to narrow down the problem, however, the key problem from my game is from my Ai scripts and the codes related to the pathfinding.

I removed the “ComputeAsync” API and created one function which compatible with my game’s terrain to achieve the same pathfinding results.

My old Ai script will break the loop once the Ais hit/touch the obstacles, as long as I removed that, the problem solved.

Hope this will help.

Welcome to play our game :stuck_out_tongue_closed_eyes: