Hello so recently my game that I’ve been working on has been having some issues.
When the game starts (works fine in studio, no issues), after about 5-15 minutes, the memory usage that I can view in Developer Console starts to steadily start increasing. It does this till it gets between 5-8gb and then the server crashes and all the players are kicked (it says they have lost connection, error: 277).
I can’t find the script that is causing this at all, and I’ve tried disabling scripts and going through them but I can’t seem to find it. I was wondering if anyone had any tips on how to remedy this issue.
Here are some screenshots I took when it last crashed:
The only reason i can think right now, it’s if you have a huge map, with lot of meshes, particles, a lot of lights etc, maybe the server can’t handle all this and crashes. Also, upload your screenshots, since there are not any, so we can assist you better.
I have the feeling that the crashes you experience are unrelated to the memory climbs since those are generally reported as two separate issues. It would help to know some of the code you’re working with, there might be a twinge of inefficiency somewhere in your implementations of certain tasks.
The game has quite a bit of code, far too much to post here. I can’t find any event connections inside of loops. However I do have a lightsaber that fires a remote every time you swing with it. Should I be looking in both client and server scripts or just server?
Forgot to mention, the time it takes for the game to crash varies.
I’ve been in a server of less than 7 people, and it has crashed in under 5 minutes.
Been in a server with less than 20 people and it’s taken 15 minutes.
The developer console has two separate tabs for server/client memory. Whichever tab has very high memory usage should be the place where the memory leak is located.
I went through every server script, and there were only two that used while loops, (neither were using events tho) and I disabled them. Made no difference, server still crash.
I’m happy to let you guys into the game in Studio if you think you can fix it. This issue has been plaguing the game for almost 2 weeks now and I really have no idea how to fix it. Can offer a reward if you want.
At this point I am really stumped, I’ve had 4 other scripters go through the game and they can’t find anything wrong.
I did remove a bunch of scripts and it ‘seemed’ to increase the time before it crashes.
In the screenshots, not sure if its easy to tell, but the game climbs from like 1gb of server memory to 7gb in the space of about 5 seconds, its not really a gradual thing but more like a giant spike that ends up crashing the server.
Hey man I was able to check it out some, from what I can tell it seems to deal with your crystal gui. When selecting new crystal colors while saber is equip it will then start spiking the memory ( I seen in the crystal script it is doing updates on a renderstep which maybe part of it) but even with this it maybe the saberscript or how ever the crystals/colors of the sabers are changed.
So it should be something in one of the 2 scripts causing the overload.
Thanks for checking it out. Though that might be something that slightly increases the memory, I don’t think it’s the reason that the server randomly spikes to 5+ gb of memory and crashes and kicks players, unless there is something I’m missing.