> Please, how to stop    ghc-4.02 -c 
> 
> (patch level 1,  i386-linux..,  taken from  research.microsoft.com)
> 
> filling all 32m memory and swapping to disk infinitely?
> 
> I tried           -H9m,  -optC-M9m,  -K2m,  -optC-j3m,  -optC-G1
                            ^^^^^^^^^
that should be -optCrts-M9m.  Although I suspect that you'll need to set the
threshold higher than that to avoid running out of heap.  If GHC is swapping
a lot, then increasing the number of generations will help: -optCrts-G3, and
*don't* give a -H option, since this will cause GHC to use all the spare
memory for the allocation area.  Without -H, GHC will use a fixed 256k
allocation area which works well in tight swapping conditions.  You might
also want to give -optCrts-F1.5 (instead of the default -F2) will use less
memory but garbage collect more often.

Summary: if memory is tight, try

        ghc -optCrts-G3 -optCrts-F1.5

> - nothing helps.
> The file it compiles is of about 600 lines but it always was 
> nasty for 
> ghc. The one that had broken GC in previous 4.02.

This is the file with loads of deriving clauses?  Remember each deriving
causes code to be generated by the compiler for the required instance.
Deriving classes such as Show and Read is particularly expensive.

Cheers,
        Simon

Reply via email to