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

GHC ghc-devs at haskell.org
Tue Jan 30 19:10:05 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
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 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

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


More information about the ghc-tickets mailing list