Client Getting Slower

I’m not entirely sure how to ask this, so I’ll just be blunt about it. I’ve noticed in a few games, specifically games that use and delete a lot of parts, that my FPS begins to drop over time as I play. Rejoining the game seems to fix this issue until it occurs again. My theory is that these deleted parts are being stored in memory and never being cleaned out, but I feel like something like that would be managed right? I came across something called Garbage Collection, not sure if that has anything to do with it.

I guess what I’m trying to ask is, what could be causing this drop in FPS as I play and how could it be fixed?

Thanks

I think if there is a massive deletion of parts, it would cause some lag if it is being destroyed by the server since that will replicate to all clients.

Probably because there are many connections that are not disconnected, causing an excess of memory buildup overtime. There are many other factors to consider, too. Are you deleting things? Using variables properly?


Replying you your question below:

Deleted objects have all connections associated with them disconnected.

This is the wrong section for this. You need to put things like this in the Engine Category.

In the particular game that I’ve been playing, attacks have hit boxes. I’m assuming that those touch events are never being disconnected after deletion then?

Ah, well the reason I posted here is because it’s likely script related.

Actually, anything that has been destroyed (using Destroy) will lose it connection entirely.

It’s about the Client so it should not be in this section also Scripting Support is if you are stuck on a script or something like that.

Anything else that it could be? I also noticed that anything that’s destroyed can still be referenced. It seems to me that the only thing destroying does is lock the parent property to nil, although it’s good to know that it also disconnects events automatically.

Unless there is a lot of particle effects in the server, I have no more idea.

It could be a memory leak.

Memory leaks tend to drop FPS over time.

There’s a bit of that too, but it’s mainly parts being spawned and deleted often, with touch events. Rhythm Track has the same issue.

I doubt it, but is there any separate way to clear up memory? Perhaps a way to collect all events or something and disconnect them that way? Kind of a vague thing, but I know that there are other types of collections.

Is there anything that is replicating from the server to the client repeatedly? (Part added to server for 50 times in just a second)

Thats why I said it could be a memory leak, we don’t know yet.

Memory leaks can happen in many ways, connections can be one of them.
Only way to “clear up” memory is to fix the memory leak by disconnecting unused connections.

I think effects are done client side, triggered by an event? But I’m not entirely sure. But I do know that there are often a lot of effects that don’t go away all of the time. However, removing them doesn’t seem to improve performance at all.

If things are being done by the client, then its the hosts job to do it. If there has to be a lot done, for example many parts being created and destroyed, it can hammer the CPU pretty hard. Lowering the FPS.

Would disabling a script clear up memory leaks?

I dont think its a memory leak anymore as you stated effects are done by the client.

Disabling the script causing the leak would fix it, but it might break the game if the script is required for the game to run properly.

Worth a shot then, I suppose. I have no idea what else would cause these leaks. Rhythm Track also does almost everything client-side, including spawning the parts on the track, and also has the same FPS drop over time.