swordbattle memory leak

tbh when the lagged stop it sented me back on my screen pov. and i couldn’t text or move before when i was lagging it was hard. but when i was lagging during that time it sented me off the map somehow?! i thought u saw it and was confused! and i thought i took the pic!

this was all the pics i had yestrday bruh and somehow no pics of me lagging off the map?!

The lag is back and its 5x worse
image
And yeah its obviously server lag because its the tps thats suffering

2 Likes

image

It’s because there’s a lot of people on but I will monitor it more in the coming days, thanks for letting me know .I think it’s happening because of the higher playercounts and it can’t recover from that for some reason

1 Like

Interesting :thinking:

I’m guessing the games older playerbase has left and a newer slightly younger one has joined since I see way too much toilet in ppls names lol

I mean swordbattle partners like play-games and gameszap are mainly promoted to way younger kids

1 Like

I didn’t have lag before but if I get 70k and above it starts going crazy for me

1 Like

Doing some tests but if it doesn’t work I’ll just revert it to an old v2 version and slowly bring back changes until I can narrow down the code that causes it

alright

i start going in my thousands and i start lagging bro.

oh wow strange

swordbattle currently investgating a memory leak?

The server lag
Thats all it is

yep thats what it is, has been discussed before.

Update on this, I have coded a test fix but have to fix one minor coin bug then I’ll push it and see if it stops the memory leak. Memory leaks are hard to debug because it’s hard to pinpoint exactly what code causes it but I think I found the culprit and lets see if it works. Will update in this topic soon

1 Like

Yoo Epik how do memory leaks work tho? Anyone who is smart can dumb it down for me?

1 Like

Yeah your lucky I’m bored so basically you know how computers have ram? Another word for ram is memory (not to be confused with storage). The thing with memory is that its super fast to store and access stuff in, but your limited (like for example an average amount of ram/memory is 16gb but for storage an avg about goes as high as 1TB = 1000gb). The drawback of ram is that also when you stop giving power to a ram stick it will lose all its

When your making a multiplayer game server, you want it to be as fast as possible since things are constantly being read and written. Example player positions, the direction their pointing in, and more. Thats why almost every multiplayer game their server stores the current game state in memory so that it can be transmitted and modified really quickly (note after a game ends, less fast-updating data can be stored on storage like a dtaabse, in the case of sb this is your gems, skins collected, and statistics which dont need to be queried as often and not modified as often as stuff actually going on in the game).

Now a memory leak is when you have a part of code that uses the memory in a wasteful way, mostly accidentaly stuff like saving the positions of dead players which will grow exponentially over time andcant get cleared so it will keep increasing until mem fills up and server slows down and eventually crashes

1 Like

On another note I pushed a test fix to the sb mem leak, looks promising so far but have to wait and see if it comes back again

image
(Mem usage, The vertical black line is after I pushed the fix)

2 Likes

Update: While I do think the memory leak got fixed I think it made some other bugs which I will be fixing tmrw and the fix also made one part of the code really inefficient so you guys are def gonna see some tps drops tommorow. I’ll try my best to fix it by end of this week and get skin update in.

4 Likes