[GHC] #8257: System.Mem: Expose performMinorGC

#8257: System.Mem: Expose performMinorGC ------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.6.3 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- We already have {{{ performGC }}} which triggers a major garbage collection. In many cases, it is useful to trigger a minor one; exposing it is as simple as Simon Marlow suggested in https://groups.google.com/d/msg/fa.haskell/-q6sINValu8/_Z7odE6O5PsJ. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8257 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8257: System.Mem: Expose performMinorGC -------------------------------------+------------------------------------ Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by nh2): Implemented in: https://github.com/nh2/packages- base/compare/performMinorGC (Could not test it because master does not compile for me at the moment.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8257#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8257: System.Mem: Expose performMinorGC -------------------------------------+------------------------------------ Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by nh2): Master compiled now, and so does my patch. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8257#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8257: System.Mem: Expose performMinorGC -------------------------------------+------------------------------------ Reporter: nh2 | Owner: Type: bug | Status: patch Priority: normal | Milestone: 7.8.1 Component: libraries/base | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by nh2): * status: new => patch * milestone: => 7.8.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8257#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8257: System.Mem: Expose performMinorGC -------------------------------------+------------------------------------ Reporter: nh2 | Owner: Type: bug | Status: patch Priority: normal | Milestone: 7.8.1 Component: libraries/base | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by hvr): ..as far as I understood, having only `performMinorGC` without the ability to inhibit major GCs seems to be of little use, so do you plan on implementing something like {{{#!hs disableMajorGC, enableMajorGC :: IO () }}} as well? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8257#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8257: System.Mem: Expose performMinorGC -------------------------------------+------------------------------------ Reporter: nh2 | Owner: Type: bug | Status: patch Priority: normal | Milestone: 7.8.1 Component: libraries/base | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by nh2): It is very useful for us, since our minor GCs are simply coming at the wrong time. Imagine a loop that does something for 5 ms and then sleeps for 5 ms. Currently, ghc schedules the minor GCs right into the ''doing something'' part significantly decreasing its performance. By triggering a minor GC in the pause, it almost never interrupts the active part. If ghc thinks that it is time for a major collection, we trust its glorious decisions. {{{ disableMajorGC, enableMajorGC :: IO () }}} would be a useful addition as well, but are out of the range of this feature request. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8257#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8257: System.Mem: Expose performMinorGC
-------------------------------------+------------------------------------
Reporter: nh2 | Owner:
Type: bug | Status: patch
Priority: normal | Milestone: 7.8.1
Component: libraries/base | Version: 7.6.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Comment (by Austin Seipp

#8257: System.Mem: Expose performMinorGC -------------------------------------+------------------------------------ Reporter: nh2 | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.8.1 Component: libraries/base | Version: 7.6.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by thoughtpolice): * status: patch => closed * resolution: => fixed Comment: Done - thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8257#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8257: System.Mem: Expose performMinorGC -------------------------------------+------------------------------------ Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: libraries/base | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by nh2): * status: closed => new * resolution: fixed => Comment: http://www.haskell.org/pipermail/ghc-devs/2013-September/002673.html Should be called `performGC` as in https://github.com/nh2/packages- base/compare/performMinorGC#diff-47720fb082e9d394a3dd535fa60a3da9R49 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8257#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8257: System.Mem: Expose performMinorGC -------------------------------------+------------------------------------ Reporter: nh2 | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.8.1 Component: libraries/base | Version: 7.6.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by thoughtpolice): * status: new => closed * resolution: => fixed Comment: Fixed. I had to recreate the patch since it fell out of sync with master (we deleted some of the code it touched,) and I forgot to `--amend` my patch with the typofix. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8257#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC