[Haskell-cafe] Space leak when returning pairs?

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Fri May 19 13:04:33 EDT 2006


Shin-Cheng Mu <scm at ipl.t.u-tokyo.ac.jp> wrote:

> I was wondering where the space leak came from and suspected
> that it's the leak described in one of Philip Wadler's
> early paper Fixing Some Space Leaks With a Garbage Collector (1987).

> But since Wadler has addressed this problem a long time ago,
> I think the fix he proposed should have been implemented in
> GHC already. Was that really the source of the space leak?
> If so is there a way to fix it? Or is there another reason
> for the leak?

I compiled and profiled your code using nhc98 instead of ghc.  There was
no space leak visible.  Since nhc98 does implement the Wadler GC fix
(with refinements by Sparud), I can only assume that this does indeed
account for the space improvement over ghc.

Regards,
    Malcolm


More information about the Haskell-Cafe mailing list