Would memory usage like this cause problems?

It doesn’t seem to be rising per se, but I feel like I shouldn’t really be doing this.
So… Is it okay like this, or should I find a way to fix it?

Do you disconnect events when no longer in use

Yes I do, I’ve made sure countless times. As I said it doesn’t feel like it’s rising too much.

As long as you don’t have any massive memory leaks on then memory usage shouldn’t really be an issue, especially on the client. What could slow down your client experience would be performing expensive operations every frame such that they end up taking too much runtime. Clients don’t run for as long as servers do so as long as the servers are secure of leaks then you should be fine in terms of memory.

Without knowing the scale of the y-axis in your screenshot I can’t tell 100%, but it looks really good honestly. In my experience regular oscillations like that indicate that the memory usage is stable. It’s not constantly stepping upwards for long periods of time, so it’s totally fine. The y-axis could be potentially scaled such that those up and downs only range a few megabytes. Your memory usage is actually trending downwards, further showing signs of stable memory use. The screenshot just needs to be a bit wider.

Here are some snapshots of the total memory and lua heap in my game after a few minutes of joining. Notice how it never stays still.

In these pictures the usage fluctuates over dozens of megabytes a minute, but it never rises perpetually

Here the scale on the y-axis is only a few megabytes, so overall this is a stable state of the client.

I was running the client for 10-20 minutes and the client usage remained around 880 MB with the lua heap remaining around 90-100 MB. Notice how it will never stay flat on the client.

After 30 minutes being idle, the client memory usage remained stable, so clearly no additional resources have been taken up in the background.


Total memory after 30 minutes:

Live server memory after 15 hours remained stable around 1 GB. Place script memory (server scripts) seemed to be in a gradual but slow rise.

However, 10 mins later, the place script memory appeared to have cleaned up some memory. Our servers often last for 12-24 hours just fine so this makes sense. Whatever memory that does accumulate on the server is slow enough such that memory increase isn’t a problem at the moment. In the first 2 hours memory usage is around 850 MB.

Thanks for the clarification - I was worried I would have to rescript my entire game, I’ve been ripping my hairs out trying to “fix” it for a while.

I should’ve paid more attention to the overall memory usage, as it’s constantly at around 1140mb. (It’s quite a big game)

Actually, another thing about server memory leaking, I have a projectile script that does all movement on the server - if that lags people would know.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.