My weekend plan fell apart fairly quickly :)
After updating SVN repositories for all 4 branches involved under Windows and my Ubuntu virtual machine, first task was to merge code. Don’t ask why, but I somehow stumbled upon a line of code that literally blew me away: for every incoming game connection, a 64Kb block of memory is allocated. The only other reference to this memory was in the disconnect code, which freed it.
Ok, well that’s 76Mb of RAM saved per server.
Now … wtf was I doing before this distracted me?
5 Comments
gonna hate to quote yourself but here we go
https://kfsone.wordpress.com/2010/07/24/plan-for-the-weekend/
Our code is a wealth of interesting times.
Ah, legacy code. Always a great fun.
That said, there are of course good reasons to allocate an “emergency memory block” on client connection, which then can be used to make sure important data – say, the character state – still gets saved consistently even if the server runs into an out-of-memory situation. You just have to then actually USE this block in your emergency shutdown procedures.
I think i need to do some maths to figure how many connection you guys get.
Trackbacks and Pingbacks
[…] kfsone Leave a comment Go to comments I wound up distracting myself even more from my already sidelined weekend […]