[GHC] #14741: High-memory usage during compilation using Template Haskell

GHC ghc-devs at haskell.org
Tue Jan 30 19:12:50 UTC 2018


#14741: High-memory usage during compilation using Template Haskell
-------------------------------------+-------------------------------------
        Reporter:  donatello         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Old description:

> When trying to embed some files into an executable using Template
> Haskell, I find that memory usage during compilation exceeds 4GB and
> often crashes my laptop. The files I am trying to embed are only about
> 25MB in size (totally 35MB in size).
>
> I made a somewhat minimal example to demonstrate this problem. To embed
> the files, I am using the [https://hackage.haskell.org/package/file-embed
> `file-embed`] package (the issue persists when using the alternative
> [https://hackage.haskell.org/package/wai-app-static `wai-app-static`]
> package too. The code to demonstrate runs in Linux and is available here
> - https://github.com/donatello/file-embed-exp. To try it out, just clone
> the repository and run Make (it uses the Haskell Stack tool and the Linux
> dd utility).
>
> This appear to be an issue in GHC. Is there anyway to mitigate the issue
> in the current version?
>
> Related discussion: https://github.com/snoyberg/file-embed/issues/24

New description:

 When trying to embed some files into an executable using Template Haskell,
 I find that memory usage during compilation exceeds 4GB and often crashes
 my laptop. The files I am trying to embed are only about 25MB in size
 (totally 35MB in size).

 I made a somewhat minimal example to demonstrate this problem. To embed
 the files, I am using the [https://hackage.haskell.org/package/file-embed
 `file-embed`] package (the issue persists when using the alternative
 [https://hackage.haskell.org/package/wai-app-static `wai-app-static`]
 package too. The code to demonstrate runs in Linux and is available here -
 https://github.com/donatello/file-embed-exp. To try it out, just clone the
 repository and run `make` (it uses the Haskell Stack tool and the Linux dd
 utility).

 This appear to be an issue in GHC. Is there anyway to mitigate the issue
 in the current version?

 Related discussion: https://github.com/snoyberg/file-embed/issues/24

--

Comment (by donatello):

 Fixed typo.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14741#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list