[GHC] #15111: GHCi leaks the first modules loaded
#15111: GHCi leaks the first modules loaded -------------------------------------+------------------------------------- Reporter: simonmar | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Keywords: ghci | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- How to reproduce the leak: {{{ cd nofib/real/veritas ghci +RTS -S Prelude> :load Main *Main> System.Mem.performGC 10554832 32639712 38824584 0.048 0.058 2.317 8.386 0 0 (Gen: 1) }}} Live data is ~38Mb (3rd number). Now unload everything: {{{ *Main> :load Prelude> System.Mem.performGC 4005376 32681280 38850224 0.013 0.048 2.330 29.896 0 0 (Gen: 1) }}} Note the live data didn't go down. Load the program again: {{{ Prelude> :load Main ... *Main> System.Mem.performGC 16344112 47790304 54799632 0.070 0.074 4.343 82.235 0 0 (Gen: 1) }}} Note the live memory is almost 2x what it was before. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15111> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15111: GHCi leaks the first modules loaded -------------------------------------+------------------------------------- Reporter: simonmar | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: ghci Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonmar): * owner: (none) => simonmar -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15111#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15111: GHCi leaks the first modules loaded -------------------------------------+------------------------------------- Reporter: simonmar | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: ghci Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | Phab:D4658,Phab:D4659 -------------------------------------+------------------------------------- Changes (by simonmar): * differential: => Phab:D4658,Phab:D4659 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15111#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15111: GHCi leaks the first modules loaded -------------------------------------+------------------------------------- Reporter: simonmar | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: ghci Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4658 Wiki Page: | Phab:D4659 -------------------------------------+------------------------------------- Changes (by simonmar): * differential: Phab:D4658,Phab:D4659 => Phab:D4658 Phab:D4659 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15111#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15111: GHCi leaks the first modules loaded -------------------------------------+------------------------------------- Reporter: simonmar | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: ghci Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4658 Wiki Page: | Phab:D4659 -------------------------------------+------------------------------------- Comment (by Simon Marlow <marlowsd@…>): In [changeset:"5fe6aaa3756cda654374ebfd883fa8f064ff64a4/ghc" 5fe6aaa/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="5fe6aaa3756cda654374ebfd883fa8f064ff64a4" Add -fghci-leak-check to check for space leaks Summary: Space leaks in GHCi emerge from time to time and tend to come back again after they get fixed. This is an attempt to limit regressions by * adding a reliable detection for some classes of space leaks in GHCi * turning on leak checking for all GHCi tests in the test suite, so that we'll notice if the leak appears again. The idea for detecting space leaks is quite simple: * find some data that we expect to be GC'd later, make a weak pointer to it * when we expect the data to be dead, do a `performGC` and then check the status of the weak pointer. It would be nice to apply this trick to lots of things in GHC, e.g. ensuring that HsSyn is not retained after the desugarer, or ensuring that CoreSyn from the previous simplifier pass is not retained. Test Plan: validate Reviewers: bgamari, simonpj, erikd, niteria Subscribers: thomie, carter GHC Trac Issues: #15111 Differential Revision: https://phabricator.haskell.org/D4658 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15111#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15111: GHCi leaks the first modules loaded -------------------------------------+------------------------------------- Reporter: simonmar | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: ghci Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4658 Wiki Page: | Phab:D4659 -------------------------------------+------------------------------------- Comment (by Simon Marlow <marlowsd@…>): In [changeset:"f27e4f624fe1270e8027ff0a14f03514f5be31b7/ghc" f27e4f6/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="f27e4f624fe1270e8027ff0a14f03514f5be31b7" Fix GHCi space leaks (#15111) Summary: There were a number of leaks causing previously loaded modules to be retained after a new `:load`. This fixes enough leaks to get the tests to pass from D4658. Test Plan: See new tests in D4658 Reviewers: niteria, bgamari, simonpj, erikd Subscribers: thomie, carter GHC Trac Issues: #15111 Differential Revision: https://phabricator.haskell.org/D4659 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15111#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15111: GHCi leaks the first modules loaded -------------------------------------+------------------------------------- Reporter: simonmar | Owner: simonmar Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: fixed | Keywords: ghci Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4658 Wiki Page: | Phab:D4659 -------------------------------------+------------------------------------- Changes (by simonmar): * status: new => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15111#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15111: GHCi leaks the first modules loaded -------------------------------------+------------------------------------- Reporter: simonmar | Owner: simonmar Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: fixed | Keywords: ghci Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4658 Wiki Page: | Phab:D4659 -------------------------------------+------------------------------------- Comment (by Simon Marlow <marlowsd@…>): In [changeset:"5b6ef59f99590128394b9dd9717b07fa971f6fc0/ghc" 5b6ef59/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="5b6ef59f99590128394b9dd9717b07fa971f6fc0" Add -fghci-leak-check to check for space leaks Summary: (re-applying this patch now that D4659 is committed) Space leaks in GHCi emerge from time to time and tend to come back again after they get fixed. This is an attempt to limit regressions by * adding a reliable detection for some classes of space leaks in GHCi * turning on leak checking for all GHCi tests in the test suite, so that we'll notice if the leak appears again. The idea for detecting space leaks is quite simple: * find some data that we expect to be GC'd later, make a weak pointer to it * when we expect the data to be dead, do a `performGC` and then check the status of the weak pointer. It would be nice to apply this trick to lots of things in GHC, e.g. ensuring that HsSyn is not retained after the desugarer, or ensuring that CoreSyn from the previous simplifier pass is not retained. Test Plan: validate Reviewers: bgamari, simonpj, erikd, niteria Subscribers: thomie, carter GHC Trac Issues: #15111 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15111#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC