Re: Swap File in Circle

From: Cervo (chrisf@PTD.NET)
Date: 07/03/98


The code is efficient, but all muds face the problem that once they become
popular, hundreds of players come on, and fill up the memory.  Even the
best coded muds will eat up tremendous amounts of memory at this amount,
and are thrown off of their systems.  I want to make a last resort to swap
it to disk.  A no other way final stand, just in case it ever happens.
I've seen linux's memory manager, and it is quite complex, and not very
practical to implement something like it in circlemud, so if there is no
way to do it with significantly less memory usage by the manager itself,
then it isn't worth it.  The only other way I could see is to make a
"memory manager" which really consists of a system controlling read/write
access to binary files, and making players who connect to the mud, zones
and areas, and everything else into binary files on the disk, and changing
the entire structure of the mud to read from the binary files instead of
memory, but this way would be tremendously slow, and that is not good for
the mud either.

>         Another thing you may or may not have noticed...all your memory
> access is not direct. malloc, and free, and the like, these don't actually
> affect the memory in the way you might expect. They make requests, which
> the os grants in its own way, and time.  Memory free'ed for instance, may
> not be immediately released.  Etc.
In some operating systems I have seen commands that force the freed memory
for malloc back to the operating system, and I'm sure with asm there is a
way to do it to the OS's that don't have a command to force freed memory
back to the operating system.  Well it was part of a certain library,
which I forget now.  Some memory library for linux ( that must narrow it
down :P ).


>         What this comes to is that you cannot _directly_ affect your
> memory usage in the way that you'd like, unless you have your very own
> manager, which consists mainly on files apparently.

Not a totally bad idea tho, I can see it now :P

autorun
Init Memory manager [........   ]
Starting Swap Engine [.      ]
bin/circle :P

Kind of a DOOM like startup screen :P  Anyway with my own memory manager
it may just be possible to save the mud during a SIGSEGV, or even write
more debugging information.  The possibilities are endless.


     +------------------------------------------------------------+
     | 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