[DGD] 1.2.133

Felix A. Croes felix at dworkin.nl
Fri Dec 21 02:26:07 CET 2007


Shentino <shentino at gmail.com> wrote:

>[...]
> Would this include "mopping up" references to destructed objects?,
> like, say, swapped out object X has references to newly destructed
> object Y.  Does your "garbage collection" cover combing out old Y refs
> from X's dataspace?  Also, if so how aggressively are they mopped up?
> Is it like a "shoot on sight" deal on swapin?  I'm just curious,
> that's all.

"Full" garbage collection is about self-referential datastructures
composed of arrays, mappings and light-weight objects.  These can
only be removed when the object they're in is swapped out, so a
healthy swaprate is actually a good thing for a mud.

Persistent objects have special handling.  Check what the
DESTRUCTED macro in interpret.h does and you'll understand.


> Also, something I wanted to ask you.
>
> I did some snooping in the source and found something very surprising.
>
> Namely, that swap_fragment seems to have more influence on runtime
> memory usage than cache_size.  The d_swapout seems to pick some
> certain fraction to "swap out" ALL THE TIME, not just when it's over
> cache_size.

Swap_fragment works the way you think it does, and cache_size is
the size of the sector cache which is something altogether different.

Most people expect DGD swapping to work like OS swapping.  They
want to see a lower limit on the resident set size below which
swapping does not occur, and a higher limit having to do with
the maximum amount of memory DGD is supposed to allocate.  The
problem here is that OS swapping doesn't work well.  As I've
mentioned above, it is a good thing in DGD that swapping happens
whenever there is activity, and a maximum resident set size would
be too abrupt a barrier.  In the case of an operating system, you
really don't want it to swap at all since the impact on performance,
once it starts, is large.

What this means is that you're stuck with a vague parameter and
a process that will use more memory when it's busy.  I plan to
tweak it in the future, though. :)

Note that with "swapping" I mean storing an object in, or
retrieving it from, the sector cache.  Actual swapping to disk
need not occur.  And the cache_size parameter <is> related to
the working set size (of sectors).

Regards,
Dworkin



More information about the DGD mailing list