Memory usage exploding for complex pattern matching

Ben Gamari ben at
Thu Mar 29 15:26:29 UTC 2018

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

> Dear ghc-devs,
> We are working on a library and came across quite high memory consumption
> when compiling some code (generated by TH).
> This memory issue seems to come from the exhaustiveness checker as
> we found in:
> We came up with a "minimal" example that at least is self contained and
> triggers the problem; `runghc Minimal.hs` should finish with about 5GB of RAM.
Hmm, with 8.2 I'm seeing a peak memory usage of 3.5 GB, with that peak
occurring during renaming, not desugaring (when exhaustiveness checking
happens). Are you certain that the exhaustiveness checker is the
responsible party?


- 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