Skip to content

Got Unable to commit 16777216 bytes of memory error on Ubuntu

When running stack build on Ubuntu 18.04 on an AWS t2-micro instance (1 GB RAM), I got the following error:

Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-8.0.2.                                      
Installed GHC.                                                                  
Populated index cache.    
stack: internal error: Unable to commit 16777216 bytes of memory
    (GHC version 8.2.2 for x86_64_unknown_linux)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
  1. .. After which there's no more output and stack build seems to hang. Any guidance here would be appreciated, thanks!
Trac metadata
Trac field Value
Version 8.2.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information