[DGD]Re: editor() and swapout() problems
Mikael Lind
z94lind at mtek.chalmers.se
Thu Apr 15 16:42:11 CEST 1999
On Thu, 15 Apr 1999, Felix A. Croes wrote:
> Mikael Lind <z94lind at mtek.chalmers.se> wrote:
>
> > The first time any object on my mud calls editor() or swapout(), dgd
> > prints out a lot of lines of what seems to be debugging messages. They
> > look like:
> >
> > FREE(000f122c/72), array.c line 1109:
> > 03 01 'd '. 00 0f '8 cc 04 01 00 03 00 00 00 05 03 01 'd '. 00 0f '8 ', 04 01
> > FREE(0010c644/48), array.c line 1109:
> > 03 01 'e 'r 00 0f 'R 80 04 01 00 05 00 00 00 07 03 01 'Y ': 00 0f '> 98 04 01
> > [...]
>
> This is indeed a debug message, and there are two ways in which it
> can occur. The first is when you have arrays or mappings with
> circular links in them, with the most simple case being:
>
> A = allocate(1); A[0] = A;
>
> The circular reference may involve more than one array. For example,
> B[0] may be A and A[0] may be B. Alternatively, the messages may be
> caused not by a circular array reference, but by a memory leak in DGD.
>
> The more telling FREE messages will be those which refer to strings,
> since they will contain (part of) the string involved. In case of
> a memory leak, they will help track down the specific cause of the
> leak. Partially as a result of these messages, DGD does not have
> any known memory leaks, so my guess is that in this case, there are
> circular array references involved.
Yes, I do have circular array references in my object daemon. I didn't
realize that this caused memory problems, although I probably should have
suspected it. I'll just recode the object daemon so that it no longer uses
circular references.
> The messages are generated only when the kfun swapout() is called,
> or when DGD decides on its own to perform a swapout for housekeeping
> reasons.
Could the latter be the case when editor() causes the debug messages to be
shown?
> [...]
>
> If you just want to be rid of the messages, compile array.c without
> defining the macro DEBUG.
I won't do that, but thanks a lot for the information. It was really
helpful. :)
// Mikael
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list