[GHC] #10289: compiling huge HashSet hogs memory

GHC ghc-devs at haskell.org
Thu Oct 22 17:35:55 UTC 2015


#10289: compiling huge HashSet hogs memory
-------------------------------------+-------------------------------------
        Reporter:  zudov             |                Owner:
            Type:  bug               |               Status:  infoneeded
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.1
      Resolution:                    |             Keywords:
Operating System:  Linux             |         Architecture:  x86_64
 Type of failure:  Runtime           |  (amd64)
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by bgamari):

 * status:  new => infoneeded


Comment:

 zudov, I'm having trouble reproducing this. With ghc 7.10.2, `unordered-
 containers-0.2.5.1`, and `text-1.2.1.3` I find the following,
 {{{
 $ ghc -O EntitySet.hs -fforce-recomp -ddump-inlinings +RTS -s
 [1 of 1] Compiling Text.Html.Entity.Data.EntitySet ( EntitySet.hs,
 EntitySet.o )
 Inlining done: Data.HashSet.fromList
 Inlining done: Data.HashMap.Base.empty
 Inlining done: Data.Text.pack
 Inlining done: GHC.Base.build
 Inlining done: Data.Text.pack
 Inlining done: GHC.Base.build
 ...                                  # goes on for a few thousand lines
 Inlining done: Data.Text.pack
 Inlining done: GHC.Base.build
 Inlining done: GHC.Base.foldr
 Inlining done: GHC.Base.id

    2,541,860,520 bytes allocated in the heap
      412,058,088 bytes copied during GC
       57,559,000 bytes maximum residency (11 sample(s))
        3,015,736 bytes maximum slop
              140 MB total memory in use (0 MB lost due to fragmentation)

                                      Tot time (elapsed)  Avg pause  Max
 pause
   Gen  0       776 colls,     0 par    0.405s   0.406s     0.0005s
 0.0141s
   Gen  1        11 colls,     0 par    0.261s   0.261s     0.0237s
 0.0615s

   TASKS: 4 (1 bound, 3 peak workers (3 total), using -N1)

   SPARKS: 0 (0 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled)

   INIT    time    0.003s  (  0.003s elapsed)
   MUT     time    1.533s  (  1.660s elapsed)
   GC      time    0.666s  (  0.667s elapsed)
   EXIT    time    0.018s  (  0.018s elapsed)
   Total   time    2.232s  (  2.349s elapsed)

   Alloc rate    1,658,595,906 bytes per MUT second

   Productivity  70.0% of total user, 66.5% of total elapsed

 gc_alloc_block_sync: 0
 whitehole_spin: 0
 gen[0].sync: 0
 gen[1].sync: 0
 }}}

 The inlinings you are observing sounds quite reminiscent of #10528, which
 should be fixed with `text-1.2.1.3`. Could you test this?

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


More information about the ghc-tickets mailing list