Well, unstability is that, unstable
I don’t see the innards of the process, so I just can assume that somehow the jail kills the player that goes beyond the limits of dynamic memory. The thing is that my precompiled HS bot had zero “Killed” timeouts after reducing hashtables to 99MB, and only 1 normal timeout in about 500+ matches, even packed into a C++ code.
C# test bot starts with a high memory usage. Command ps -aux shows:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
u65601 1 0.0 5.3 128796 13896 ? Sl 18:44 0:00 /usr/bin/mono --debug -O=-inline /tmp/Tester.exe
And after vector initializations:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
u65601 1 4.0 11.1 142376 29332 ? Sl 18:44 0:00 /usr/bin/mono --debug -O=-inline /tmp/Tester.exe
Almost not new memory reserved (I don’t understand it, but magics of the managed code).
In C++ is different:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
u65501 1 0.0 1.2 7652 3404 ? S 18:54 0:00 /tmp/Answer
INIT CACHE 142187KB CHUNK3906 SIZE:749952 524288
After initialization:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
u65501 1 14.0 76.7 205488 201240 ? S 18:54 0:00 /tmp/Answer
cat /proc/meminfo is 256MB
MemTotal: 262144 kB
MemFree: 262144 kB
SwapTotal: 0 kB
SwapFree: 0 kB
ulimit seems normal (8MB stack is meh, but that’s vanilla linux):
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 8192
coredump(blocks) 0
memory(kbytes) unlimited
locked memory(kbytes) 16384
process 100
nofiles 200
vmemory(kbytes) unlimited
locks unlimited
rtprio 0
76% mem usage seems a bit too high, maybe something is killing the process as a protection. Maybe the first player doesn’t pass the limit, but the second one does, and as someone is killed the rest of players are good to go, unstability as its finest