Re: Garbage Collection in Circle

From: James Turner (turnerjh@XTN.NET)
Date: 06/04/98

Patrick Dughi <dughi@IMAXX.NET> writes:

> This is regarding the memory garbage collector that James Turner spoke
> about recently. He said that he was going to do some testing, but I don't
> think I've heard anything about it since then.

I did some work with it (details below) but no one seemed to show
interest in it so I never followed up on my post *grin*

>         I don't actually have any hard stats on it, though if you'd really
> like those, I'm sure I could manage to post those up.
>         I'd recommend it, and will post up a bit of information about how
> to get it running with your code in a while, since it was a bit of a
> hassle to get it to compile and run smoothly.

I ran into a few problems with it.  After about 12 hours uptime, my
mud was consuming anywhere from 50% to 90% more memory than with
explicit free's.  This is just too high for me... I've worked hard to
keep other memory use low, and I don't like this inflating to such
extremes.  Perhaps others' luck will vary in this regard.

Another problem I had is this.  Suppose you pass a pointer to an
external shared library.  That library becomes the sole posessor of
that pointer.  Unfortunately, the garbage collector won't scan the
data for the shared library and it mistakenly thinks the region of
memory is no longer used.  Crash.

That bug took a while for me to figure out... it was sneaky.

Another problem is a program never uses less memory -- its memory uses
is monotonic increasing, at least with glibc2.  What happens is the
malloc library won't release the memory to the kernel/OS... but it
will reuse it.  But when the GC inflates the memory artificially, even
if it cleans up after itself, it still used malloc -- and you're using
more memory than you strictly need.

Other projects (non-mud) have uses GCing to great success... but IMO
it's not terribly appropriate for a mud (at least the Boehm GC I used
wasn't, but I suppose the problem could have been the library itself).

James Turner     

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

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