logo       

RE: space leak in compiler?: msg#00027

lang.haskell.glasgow.bugs

Subject: RE: space leak in compiler?

On 07 May 2004 08:11, Serge D. Mechveliani wrote:

> Dear GHC developers,
>
> I have tested ghc-6.2.1
> (installed from (maybe) RPM on RedHat Linux (maybe) 8)
>
> on my DoCon-2.08 application. It works, mainly.
>
> But it seems to have a space leak in the compiler.
>
> make space=-M30m docon
> (involving ghc --make ... +RTS -M30m -RTS)
>
> leads to "segmentation fault"
>
> after compling several modules.
> Repeating this command several times allows to build the program.

I'm looking into the segmentation fault. But may I make some
observations/suggestions first:

- a "space leak" is when a program is using more space than it
needs to. You haven't given any evidence that GHC has a space
leak, only that it uses more space as it compiles modules. This
isn't unreasonable.

Also, it isn't unreasonable for GHC to run out of space during
--make, but then make more progress when restarted. It could
be due to caches built up during compilation, for example.

That's not to say that GHC doesn't have space leaks, just that
you haven't given us any evidence that it does. (actually I've
spent quite a bit of time squashing space leaks in GHC, and I know
that 6.2 does have some small leaks left, but nothing major).

- If you need to compile on small memory machines, I suggest you
avoid --make, and use ordinary Makefiles or hmake instead. Both
of these will restart the compiler for each module, and hence
avoid the behaviour you're seeing. You might even get a speedup,
because the compiler won't be forced to use the compacting GC
all the time.

Cheers,
Simon


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise