[Larceny-users] freezing for garbage collection?

William D Clinger will at ccs.neu.edu
Tue Mar 4 14:02:59 EST 2008


Matt wrote:
> I did this in chicken scheme and it worked very well, but
> I decided to switch to larceny since chicken is quite slow
> in comparison.  I've got it all working except I notice
> that every so often the game will freeze up for a split 
> second, noticably, and then resume its normal speed.  Is
> this due to the garbage collector?

Probably.

I would generally expect Larceny's garbage collector
to perform better than Chicken's, but Larceny's heap
image might be substantially larger than Chicken's or
its default gc settings may be sub-optimal for your
application.

> Is there any way to fix this by changing the gc 
> settings, or by running things in a thread?

There are several gc-related things you can try.  The
first step is to see which settings make a noticeable
difference.  Here's what I'd suggest:

    % larceny -size0 4M -areas 3 -nocontract

If that helps, then you can determine which of the
three things are helping ("-size0 4M", "-areas 3",
and "-nocontract") by leaving them out.  If one of
the first two things help, then you can try increasing
the size of the nursery and/or ephemeral area still
further.

For an explanation of these settings, type

    % larceny --wizard

Although you don't ordinarily want to use the --annoy-user
switch, you may find that it helps you to understand the
effect of other switches.

With Larceny's current garbage collectors, there is no
way to avoid an occasional long pause, but at least some
of the settings suggested above should make those pauses
less frequent.

Will



More information about the Larceny-users mailing list