Memory usage exploding for complex pattern matching

Ben Gamari ben at smart-cactus.org
Thu Mar 29 15:26:29 UTC 2018


"Victor Miraldo (UU)" <v.cacciarimiraldo at uu.nl> 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:
> https://ghc.haskell.org/trac/ghc/ticket/11163
> https://ghc.haskell.org/trac/ghc/ticket/11195
>
> 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?

Cheers,

- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20180329/db11d84d/attachment.sig>


More information about the ghc-devs mailing list