This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gc notes available


Mikael Djurfeldt <mdj@nada.kth.se> writes:

 > Russell McManus <mcmanus@IDT.NET> writes:
 > 
 > > Jim Blandy <jimb@red-bean.com> writes:
 > > 
 > > > Which would people prefer?
 > > > 1) Guile becomes slower overall, but does not pause noticeable for GC.
 > > > 2) Guile becomes faster overall, and most GC pauses become
 > > >    unnoticable, but does still pause occsionally?
 > > 
 > > The only thing 1 is better for is games, I would think, since we are
 > > still not providing real-time guarantees.
 > 
 > It is also better for GUI:s.
 > 
 > If the garbage collector doesn't have some way to prevent collections
 > over all used memory (generational GC doesn't necessarily revent this;
 > see end of my recent reply to Jim), GC pauses can be long if the
 > application is large.
 > 
 > Long GC pauses is not compatible with a good GUI.  A GUI is a typical
 > thing to write in a scripting language (think of Tcl/Tk).

Several comments.

1. Tcl/Tk avoids long GC pauses by never garbage collecting.  The
   process grows without bound over time.  Would you prefer this?
2. perl avoids long GC pauses by reference counting.  This also will
   cause the process to grow without bound over time (if circular
   structures are used) and is generally thought to be much more
   costly than other forms of GC.  Would you prefer this?
3. Emacs has a non generational GC that's on the slow side.  Does its
   pauses cause a significant degradation of it's UI?
4. I wrote a tetris game for STk.  It has a non generational
   conservative GC.  The pauses are unnoticable because I increased
   the heap allocation at the beginning & call gc at times when it
   won't be noticable to the user.
5. Abuse makes heavy use of a lisp interpreter.  I assume it does GC &
   I assume it's unsophisticated (i.e. - not generational).  It's got
   a hell of a lot more action than my tetris game, and it's a hell of
   a lot bigger, and I never noticed any gc pauses getting in the way
   of the playing.
6. How often do you have to wait for programs to do things in general?
   I often have to wait for netscape, make, gcc, ... and none of them
   have gc.  Why is waiting for gc a big deal, but waiting for DNS
   resolution, or page formatting, or anything else acceptable?

You stated that if the gc always scans all of memory then the gc
pauses can be long, and if the gc pauses are long then it's bad for
the GUI.

The real issue is *how* big, *how* long, and *how* bad.

You also stated that generational GC also doesn't prevent scanning all
of memory.  This is right too, but I'd expect that anyone who has an
app for which this presents a problem will be able to tune gc usage to
deal with it - i.e. - adjust generation creation parameters & collect
during appropriate pauses in interaction.

-- 
Harvey J. Stein
BFM Financial Research
hjstein@bfr.co.il