[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Nov 30 19:10:26 1993 
Subject:Re:store leaks (drip drip...) 
From:Anthony Worrall 
Volume-ID:931130.02 

It may seem an obvious suggestion but have you tried using popgctrace?

popgctrace -> BOOL or INT                                     [variable]
BOOL or INT -> popgctrace
        If this variable (default value <false>) is true then a  message
        is output after each garbage collection, giving the GC time  and
        details of memory allocation (the characters of the message  are
        output through -cucharout-).

        The first line of the message has the form

            GC-<code>(X) <t>  MEM: u <u> + f <f> + s <s> = <m>

        where <code> is a 4-letter code indicating why the GC  happened,
        and <t> is the time for the garbage collection in seconds. X  is
        a letter indicating which garbage collection algorithm was  used
        (C = copying, N = non-copying).

        <code> is one of the following:

            auto    The combined area for relocatable structures and the
                    user stack was full.

            fixd    The area for fixed-address structures was full.

            ftbl    The internal table  of open  files/devices was  full
                    when trying to open a  device. (A GC can free  space
                    in  this  table  by  closing  and  removing  garbage
                    devices.)

            fopn    The operating-system imposed limit on the number  of
                    open devices  was  reached  when  trying  to  open a
                    device. (By closing garbage  devices, a GC can  make
                    more available.)

            plog    The  combined  area   for  the   Prolog  trail   and
                    continuation stack was full.

            save    GC done by -syssave-.

            lock    GC done by -sys_lock_system-.

            user    Direct call of -sysgarbage- from a user program.

        The MEM figures refer  to totals for all  heap segments: <u>  is
        the number of words used by structures, <f> the number free, <s>
        the number taken by  the user stack, and  <m> the total. If  the
        heap is  locked  with  -sys_lock_heap- then  an  additional  <l>
        figure precedes <u>, i.e.

            GC-<code>(X) <t>  MEM: l <l> + u <u> + f <f> + s <s> = <m>

        where <l> is the total number of words in the locked part of the
        heap (note this includes both used and unused space).

        If -popgctrace- has any non-false  value other than an  integer,
        only  the  first  line  is  output.  Additional  information  is
        obtained by  giving  it  an integer  value,  whose  bits  select
        further message lines as follows:

            Bit     Meaning
            ---     -------
             0      Same as setting  both bits 2  and 3 (for  upward
                    compatibility  in   assigning  1   to  get   the
                    callstack and Prolog information).

             1      Fixed-address structures; prints

                      FIXED: u <u> + fb <fb> + f <f> = <m>

                    where  <u>  is  the  number  of  words  used  by
                    structures,  <fb>   the   number  used   up   in
                    (discontiguous) free blocks,  <f> the number  of
                    (contiguous) free,  and  <m>  the  total.  These
                    values are  included in  the first-line  totals,
                    <fb> and <f> being subsumed together under total
                    words free.
                        (Note   that    space   for    fixed-address
                    structures is  allocated  from  free  blocks  if
                    possible, but because  of fragmentation a  given
                    figure for <fb> doesn't imply that that  much is
                    actually usable in any context.)

             2      Callstack; prints

                      CALLSTACK: <c>

                    where  <c>  is  the  number  of  words  used  by
                    procedure-call stack frames.

             3      Prolog store area; prints

                      PROLOG: trail <t> + free <f> + contn <c> = <m>

                    where <t> is  the number  of words  used by  the
                    trail, <f> the number free, <c> the number  used
                    by the continuation stack, and <m> the total.