RSS
 

Crashes Explained, but not fixed yet

20 Nov

For the last 24 hours, I’ve been crash-hunting with gdb. It was soon found that our crashes are a result of running out of memory. For those that are familiar with C, that means we are allocating memory and not freeing it. Unlike many other languages, C doesn’t have its own garbage collection so we have to do this ourselves. If you don’t, then eventually the memory gets to more than you can use, and it goes down. How fast it gets there is dependent on things like, number of players on, when the last copyover was, amount of data (such as rooms, shops and assemblies) are stored in memory.

Running Valgrind showed off where a number of these leaks are, and I’ve managed to plug up the big gapping ones. Most of which, have been on the mud for a while, its just now that we’ve reached ‘critical mass’ and the crashes are becoming more frequent that it has become a real issue. Some of them, require a significant re-write of the code and out it interacts with the player/account files. The file input output handling that circle is as leaky as a sieve… again contributing to the problem.

So, please, be patient. This is going to take me a bit to track down and sort out. And in many cases, rewrite code, I’ve not touched or really looked at much. Dynamic memory management like this isn’t something I’ve had a lot of experience with but slowly getting my head around it. I even got a half dozen books from the Waikato University library to help.

Share:
  • Facebook
  • Twitter
 
 
  1. Shock

    November 20, 2009 at 2:02 pm

    Best of luck Carm! It sounds really hard :(

     
  2. phoenix182

    November 20, 2009 at 4:44 pm

    Hmmm, I wonder if that’s why I’m so forgetful lately. Can you debug me when you’re done?

     
  3. Roh

    November 20, 2009 at 5:57 pm

    O.O Did not know that about C. :p Because I don’t do code. Sounds like what I’ve herd described as memory leaks before. Which happen in plenty of big name games. If it’s the same general thing then I suppose it’s to be expected till you can work it out.”.