[GHC] #14492: Tiered memory allocation restricts available memory

GHC ghc-devs at haskell.org
Thu May 31 02:05:54 UTC 2018


#14492: Tiered memory allocation restricts available memory
-------------------------------------+-------------------------------------
        Reporter:  unode             |                Owner:  bgamari
            Type:  bug               |               Status:  patch
        Priority:  high              |            Milestone:  8.6.1
       Component:  Runtime System    |              Version:  8.0.2
      Resolution:                    |             Keywords:  memory ulimit
Operating System:  Linux             |         Architecture:  x86_64
 Type of failure:  Poor/confusing    |  (amd64)
  error message                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D4215
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"730781b42a003604cfa047a02280757a07b09581/ghc" 730781b/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="730781b42a003604cfa047a02280757a07b09581"
 rts/posix: Use less aggressive backoff schedule for heap reservation
 sizing

 When we allocate the heap on POSIX platforms we generally just ask for a
 1TB chunk of address space and call it a day. However, if the user has
 set a ulimit then this request will fail. In this case we would
 previously try successively smaller allocation requests, reducing the
 request size by a factor of two each time.

 However, this means that GHC will significantly allocate a significantly
 smaller heap than the available physical memory size in some
 circumstances.  Imagine, for instance, a machine with 512 GB of physical
 memory but a ulimit of 511 GB: we would be limited to a 256 GB heap.

 We now use a less aggressive back-off policy, reducing by one-eighth the
 last allocation size each try.

 Thanks to luispedro for the suggested approach.

 Test Plan: Validate

 Reviewers: simonmar, erikd

 Subscribers: rwbarton, thomie

 GHC Trac Issues: #14492

 Differential Revision: https://phabricator.haskell.org/D4215
 }}}

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


More information about the ghc-tickets mailing list