Ticket #2185 (closed bug: fixed)

Opened 4 years ago

Last modified 21 months ago

Memory leak with parMap

Reported by: igloo Owned by: simonmar
Priority: high Milestone: 7.0.1
Component: Runtime System Version: 6.8.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Runtime performance bug Difficulty: Moderate (less than a day)
Test Case: Blocked By:
Blocking: Related Tickets:

Description

With the attached All.hs, if you run the program without any arguments (so that it uses parMap rnf in gen_blocks_list) then its memory usage keeps going up, even though at the top level it's just running the same computation 5 times in a row. Memory usage goes up to over 100M.

If you give an argument (any argument, so that it uses map instead) then memory usage is constant and only a few megs.

Happens in 6.8.2 and the HEAD.

Attachments

All.hs Download (4.8 KB) - added by igloo 4 years ago.

Change History

Changed 4 years ago by igloo

Changed 4 years ago by igloo

Forgot to say: Compiling with

ghc -Wall -fforce-recomp All.hs --make -fasm -O2 -threaded -fglasgow-exts -funbox-strict-fields -fbang-patterns -debug

I haven't experimented with other flags.

Changed 4 years ago by simonmar

  • owner set to simonmar
  • milestone changed from 6.8.3 to 6.10 branch

I think sparks are currently treated as roots by the GC, which is wrong. I won't get around to fixing this in 6.8.3, but I'll do it in the new GC code in 6.10.

Changed 4 years ago by simonmar

  • status changed from new to closed
  • resolution set to fixed

Now fixed, and I've added the program to our test suite.

Changed 4 years ago by simonmar

  • status changed from closed to reopened
  • resolution fixed deleted
  • component changed from Compiler to Runtime System

unfixed. Sparks really should be treated as GC roots, because many uses of par rely on this behaviour (including most of the strategies library).

I don't have any ideas for how to fix this yet.

Changed 3 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 3 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 3 years ago by igloo

  • milestone changed from 6.10 branch to 6.12 branch

Changed 2 years ago by simonmar

  • failure set to Runtime performance bug

Changed 23 months ago by simonmar

  • priority changed from normal to high
  • difficulty changed from Unknown to Moderate (less than a day)
  • milestone changed from 6.12 branch to 6.14.1

The  new parallel package on Hackage fixes the space leak in this program (change rnf to rdeepseq to compile it). I'm leaving the ticket open and moving it onto the 6.14.1 branch, because we still need to change the GC policy so that sparks are not treated as GC roots.

Changed 21 months ago by simonmar

  • status changed from new to closed
  • resolution set to fixed

Fixed:

Tue May 25 08:04:35 PDT 2010  Simon Marlow <marlowsd@gmail.com>
  * Make sparks into weak pointers (#2185)
  The new strategies library (parallel-2.0+, preferably 2.2+) is now
  required for parallel programming, otherwise parallelism will be lost.
Note: See TracTickets for help on using tickets.