This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Guile GC behaviour
- To: Ivan Karski <karski at nym dot alias dot net>
- Subject: Re: Guile GC behaviour
- From: "Harvey J. Stein" <hjstein at bfr dot co dot il>
- Date: Wed, 29 Sep 1999 16:51:36 +0200
- CC: guile at sourceware dot cygnus dot com
- CC: hjstein at bfr dot co dot il
- References: <19990929112008.3984.qmail@nym.alias.net>
Ivan Karski <karski@nym.alias.net> writes:
> -----BEGIN PGP SIGNED MESSAGE-----
>
> Christian Lynbech <chl@tbit.dk> writes
>
> However, the allocation of new heap segments is kind of orthogonal to
> the gc process itself. The process goes something like this: when gc
> is finished it estimates the fraction of the heap cleared up. If this
> is too small, a new heap segment is allocated.
>
> Of what size?
>
> In libguile/gc.c comments we read
>
> * SCM_INIT_HEAP_SIZE is the initial size of heap. If this much heap is
> * allocated initially the heap will grow by half its current size
> * each subsequent time more heap is needed.
>
> but the code is
>
> #define SCM_EXPHEAP(scm_heap_size) (scm_heap_size*2)
>
> So is it half or twice?
Not either, from what I recall of looking at the code yesterday.
SCM_EXPHEAP is the size of the new heap segment. So presumably heaps
are of size X = SCM_INIT_HEAP_SIZE, 2*X, 2*2*X, ... So, the heap
space with N segments = X*(1+2+...+ 2^(N-1)) ~= X*2^N. Adding a new
segment adds X*2^N elements, so the heap size doubles, or it grows by
100%.
--
Harvey Stein
Bloomberg LP
hjstein@bfr.co.il