Forum
CS2D General CS2D Bug Reportsi see two players with one id :
The current version of CS2D has a serious memory leak problem with the Lua module, it affects all Lua scripts (from what I saw).
I have been testing this in the last days and by my tests, it's more visible with the hooks "always", "ms100" and "second", since they are called very frequently. It happens even if there is no code inside the hooked functions. I suppose this affects all hooks, however it's not so visible because they are not called so frequently. The RAM usage grows slowly by 4KB, and keeps going, after 24 hours of uptime (or less), the server will be using 100 MB, 200 MB or even more of RAM.
A very easy way to test this and see it by yourself is by taking CS2D Dedicated Server 0.1.2.5, setting the map to de_cs2d and filling it with bots (because bots are Lua), notice how the RAM usage stays normal. Now do the same thing in 1.0.0.1 and watch as how the RAM usage keeps going up and up, non-stop. It will eventually reach 100 MB, 200 MB, 300 MB and so on RAM usage. It happens both on Windows and Linux (by my tests). It's unacceptable, especially on a VPS where more than 1 server is being hosted on. You can also test this by using scripts that use the hooks "always", "ms100" and "second", especially "always".
And apparently it also happens not only with hooks, but with functions too, like player(0, "table") (being called very frequently).
I said 0.1.2.5 because that's the version before DC added LuaJIT (in 0.1.2.6), he then removed it in 0.1.2.7 (I tested on it as well, the same memory leaks happened). From what I see it's where the memory leaks started.
It personally pisses me off because it forces me to change code which is right, using timers and other workarounds where they shouldn't be necessary. I hope this gets fixed in the next version.
edited 5×, last 03.12.15 06:07:12 pm
Also it has nothing to do with my code, like I said, it happens even if there is no code inside the hook (very visible with the hook "always"). And when I don't use any Lua scripts (no bots either because they are Lua too), the RAM usage stays normal (at 6~7 MB RAM).
And there is another bug which is probably related to this, when I do "rcon fps" on the console it says 0 FPS even though the server is running at 50 FPS (only happened on Linux for me, even without any Lua script being used).
edited 3×, last 03.12.15 07:04:31 pm
KINGGOLDrus has written
Unfortunately, the game has many memory leaks
After game launching and quitting:
After map loading and quitting:
After game launching and quitting:
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
ERRORS FOUND: 0 unique, 0 total unaddressable access(es) 395 unique, 30680 total uninitialized access(es) 0 unique, 0 total invalid heap argument(s) 0 unique, 0 total GDI usage error(s) 0 unique, 0 total warning(s) 42 unique, 76 total, 40508 byte(s) of leak(s) 161 unique, 1084 total, 4225236 byte(s) of possible leak(s) ERRORS IGNORED: 373 potential error(s) (suspected false positives) 627 potential leak(s) (suspected false positives) 142 unique, 393 total, 488337 byte(s) of still-reachable allocation(s)
After map loading and quitting:
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
ERRORS FOUND: 0 unique, 0 total unaddressable access(es) 722 unique, 56294 total uninitialized access(es) 0 unique, 0 total invalid heap argument(s) 0 unique, 0 total GDI usage error(s) 0 unique, 0 total warning(s) 40 unique, 46 total, 32924 byte(s) of leak(s) 215 unique, 1208 total, 36385615 byte(s) of possible leak(s) ERRORS IGNORED: 685 potential error(s) (suspected false positives) 599 potential leak(s) (suspected false positives) 534 unique, 1284 total, 1009400 byte(s) of still-reachable allocation(s)
But I was talking about the dedicated server, for me that's more serious, and it's not always practical to close and open it. Because it's something that you usually leave online 24/7... It didn't have these memory leaks in previous versions from what I can see.
EDIT: Seeing that the post is from 2015 too, the memory leak on the client is probably related to the Lua module too, I didn't realize it before. So maybe what I said above about the client is wrong. But on the dedicated server, it's very clear that it has memory leaks, and they should really be fixed.
edited 5×, last 04.12.15 03:14:07 pm
This looks like a typo. There shouldn't be a "z" in the end of the word.
z mean z axis. Height of the wall/obstacle. That's Lighting engine thing.
It still crashes the server
i know about killplayer but still
but ill try again and tell u if it still works
EDIT:
nvm it will only work on me
still weird that it will return a missing command error
(happens the same when u restart the round while its being restarted)
1
kill 4
Yes, "CS2D-Script" is very primitive
You can even do this:
1
2
2
alias "4" "echo lol" kill 4