Skip to content
  • Simon Marlow's avatar
    Squash space leaks in the result of byteCodeGen · 648fd73a
    Simon Marlow authored
    When loading a large number of modules into GHCi, we collect
    CompiledByteCode for every module and then link it all at the end.
    Space leaks in the CompiledByteCode linger until we traverse it all for
    linking, and possibly longer, if there are bits we don't look at.
    
    This is the nuke-it-from-orbit approach: we deepseq the whole thing
    after code generation. It's the only way to be sure.
    
    Test Plan:
    Heap profile of GHCi while loading nofib/real/anna into GHCi, this patch
    reduces the peak heap usage from ~100M to ~50M.
    
    Reviewers: hvr, austin, bgamari, erikd
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2419
    648fd73a