Memory usage exploding for complex pattern matching

Ben Gamari ben at
Thu Mar 29 19:57:03 UTC 2018

"Victor Miraldo (UU)" <v.cacciarimiraldo at> writes:

> Hello,
> @Ben
>> I tried 8.4 and indeed the renamer/typechecker takes dramatically less
>> memory (yay!), leaving desugar as the largest allocator (allocating
>> around 3GB) while compiling the minimal example. Furthermore, disabling
>> the pattern match checker (via -fmax-pmcheck-iterations=0) dramatically
>> reduces desugarer allocations (to around 60MByte). It looks like you are
>> right.
> I have just tried compiling my code with 8.4.2 and using
> -fmax-pmcheck-iterations=0,
> I gave GHC 12GB of ram and it still ran out (through `ulimit
> -v$((1024*1024*12))`).
Hmmm, I'm a bit confused. Why are our results so different? How
precisely are you invoking GHC?

> @Simon
>> Let's make a Trac ticket for this (since there is a nice small
>> reproducer). Or, if it seems a dup, attach the reproducer to some
>> existing ticket.
> Should I be the one creating it or adding the reproducer?
> The closest I've seen is:
Let's start with a fresh ticket; #11195 has a rather long history. Do
you think you could open it and attach your repro?


- Ben

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <>

More information about the ghc-devs mailing list