Re: Memory Problems

From: Patrick J. Dughi (dughi@IMAXX.NET)
Date: 03/11/98


> I have a serious problem with my mud, and I don't really know where to
> start to track it down.
>
        You sir, are not lying!

> Basically, the longer my mud is up and running the more and more RAM it
> uses, but not just a little, it increases by quite a bit.

                This is, plain and simple, a memory leak.  Chances are,
you're str_dup'ing w or CREATE'ing or, simply m/calloing memory, and
you're never freeing it when you're done.

        Example:

        You have an old version of oasis and you commented out the
free(proto_index) or whatever its called line.  Now what happens is each
time you use the editor, a chunk of memory the size of your mob index is
allocated to your program and never released.  You never re-use it, so it
just piles up.

        Fix this by searching for sections of code where something is
"CREATE"ed but never extracted, or malloced and never freed.

>
> When the mud boots, it uses about 17 MB RAM but after being up constantly
> for 18 hours, the RAM used by the mud increases to about 60. I thought at
> first that the increase was due to zone resets, but I can't imagine no
> matter what that it would lead to an additional 43 MB of RAM.

        Jeeus. Thats a crudload of ram.

                                                PjD


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST