Re: [NEWBIE] Memory

From: Christian Loth (sg618lo@unidui.uni-duisburg.de)
Date: 03/30/99


Hi Thomas,

(How was the way home from CeBit btw? ;) )

Am Die, 30 Mär 1999 schrieb Thomas Henke:
> Hello there,
>
> i have following problem:
>
> It seems that my mud gets more memory as it frees if the for example
> player goes out again. Or if a command, what has some output on the
> screen, is typed very often, it seems to swallow memory and not to give
> free.

As we discussed during our CeBit meetings, this can also be
not because of a memory leak, but because of memory fragmentation.
The same principles that I explained to you about the memory
consumption of the Intermud Server also is valid for the MUD
itself, especially if you have heavy 'traffic' (lots of zones where
stuff resets, lots of players, etc. etc. etc.).

There is one solution to this problem, by writing your own malloc
implementation (and of course free), that allocates pools
of a fixed size.

However if you do have the problem of memleaks, there
are three solutions:
1.) Don't code memleaks ;) *grin* This is mainly a matter of
     'coding discipline'. Have fixed rules for allocating and
     freeing stuff. Like fixed points of de-allocation in the
     code e.g. (I love c'tors and d'tors of C++ for exactly that
     reason. What an object allocates it also de-allocates).
2.) libefence, that should be part of any good Linux distribution
3.) There's the eeeeeeeexppppeeeeeeeennnnnnssssiiiiiivee
     debugger called 'Insure++'. It's a pretty cool program, but
     also pretty expensive.

My 0.02 Euro,
- Chris

--
Christian Loth
Coder of 'Project Gidayu'
Computer Science Student, University of Dortmund
sg618lo@uni-duisburg.de - chloth00@marvin.cs.uni-dortmund.de


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



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