s48 and bibop garbage collector

Vladimir Konrad <[email protected]> Thu, 25 Feb 2010 15:01:34 +0100
Newsgroups gmane.lisp.scheme.scheme48
Message-ID <[email protected]>
Hello,

When I run a simple factorial function (iterative definition, file attached) for one million, like:

(define x (factorial 1000000))

the scheme48 (both, 1.8 and 1.9T) with bibop garbage collector starts to allocate a _lot_ of ram
after a longish while (killed at around 3[GB] allocated).

I was measuring the resident size (with top command) under 64 bit linuxen (debian lenny and archlinux).

This does not happen with the twospace collector.

The factorial also works in other schemes (bigloo, gambit), and their memory usage is few hundred meg in this case.

Also, should "-h" option limit the maximum heap even for twospace garbage collector, when the number != 0 ?

My understanding is that _yes it should_, but just want to make sure (I think it does not in this case).

(btw, I know that micro-benchmarks do not prove much, my guess is that there could be a bug in scheme48 and
you might like to know.)

Kind regards,

Vladimir Konrad

Please access the attached hyperlink for an important electronic communications disclaimer: http://www.lse.ac.uk/collections/planningAndCorporatePolicy/legalandComplianceTeam/legal/disclaimer.htm
factorial-iterative.scm (text/x-scheme, 204 B)
(define (factorial n)
  (define (fact-iter product counter max-count)
    (if (> counter max-count)
        product
       (fact-iter (* counter product) (+ counter 1) max-count)))
    (fact-iter 1 1 n))