My game crashes randomly

Not sure if this will count but I use Profile Service. I think the module is pretty secure, its open sourced and I haven’t seen any complains regarding crashing from it.

what causes these memory leaks?

Adding to that are you doing any RunService events like RenderStepped, Stepped etc.?

yes i am, a lot of those actually

i use them for my custom wait functions

Memory leak

Then it might be the cause of it. Not confirming it’s the cause but could be. Who knows? Maybe the client has lag, and then it causes the client to crash or something? (Some weird guesses).

Ok then try to remove some to optimize your game

I don’t see custom wait functions causing the problem much, but try using task.wait instead of the custom wait in some places, and check if that fixes it?

Does your game lag when you play it?

ah okay. I was thinking of converting to the task.wait() instead of my custom wait (which uses a run service loop for each). Also in the microprofiler, Worker: RunJob seems to be an issue which i heard is caused from loops and such, so ill give it a try.

1 Like

not really, i have some lag spike issues when i look in certain directions of the map, but that might be caused by buildings. although it seems to stop when i get on my pc. Its also strange that i created an exact copy of my game in another baseplate (including scripts and buildings) and it works fine with no lag

Meaning when you move your camera on that direction? That’s usual.

yea, only appears to happen on my laptop how ever. also the crashing issue is hard to replicate, as i need live players in my game to be actively testing, but ill take into consideration memory leaks and run service functions

One thing that spikes my lag is this:

and this is what the micro profiler shows:

https://gyazo.com/5c16ab3f65b906f7fbde593824bcbeef

Note that this does not cause any type of lag in my other worlds. in fact, im sure a loop like this shouldnt cause lag at all, since its just a for loop, but it drops my frames every 2 seconds

after further testing, i still crash after replacing all of my custom waits with task.wait()
i do not have any while true do scripts on the client, only while wait(n) ones, or ones with while wait(n) inside of the loop. Everything also seems to be fine up until the crash. my character can be just walking around (after dying) and it just crashes

If that’s the case, maybe it’s the Roblox servers or something? I mean, the servers literally crashed like 3 weeks ago. I don’t see them fixing them the full server problem in just 3 weeks. If they were to fix it fully, then probably should take about 2-3 months. Again, I’m not an engineer, but my guess.

So, in conclusion I’ll end up saying players have been crashing randomly for the Roblox Server problem.

Awe, yea i hope it isnt a roblox issue. Although i never seen this happen to any other game. I also have new information, the crashes seem to happen when a new player joins the game. It happends inconsistently so its hard to say / replicate, but when a player joins, 1,2 or even 3 people just crash

Sorry for the late reply, but I think the reason behind that is, you’re making adding way too many stuff when the player joins. Might be the issue I’m guessing. But again, servers are still a little down, so let’s see what happens a few days later. Anyways, can you give me the game link so I can check it for myself?