[GHC] #8504: Provide minor GC residency estimates

#8504: Provide minor GC residency estimates -------------------------------------------+------------------------------- Reporter: ezyang | Owner: simonmar Type: feature request | Status: new Priority: lowest | Milestone: Component: Runtime System | Version: 7.7 Keywords: easy | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Easy (less than 1 hour) | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: | Blocking: -------------------------------------------+------------------------------- Currently, the residency statistics (e.g. max residency and current residency) are only updated when a major garbage collection occurs. While this is the only way to ensure an accurate residency count, there are times when a residency estimate would be desirable, since only taking the sample on major GC can be somewhat low resolution. We already collect and report this information on verbose GC stats, so all that needs to be done is to expose it via GHC.Stats. Should be an easy patch, good for someone who wants to play around in the RTS. Here is a simple patch that switches residency to the inaccurate version: {{{ diff --git a/rts/Stats.c b/rts/Stats.c index c19f23c..c71d0fb 100644 --- a/rts/Stats.c +++ b/rts/Stats.c @@ -449,7 +449,6 @@ stat_endGC (Capability *cap, gc_thread *gct, CAPSET_HEAP_DEFAULT, mblocks_allocated * MBLOCK_SIZE_W * sizeof(W_)); - if (gen == RtsFlags.GcFlags.generations-1) { /* major GC? */ if (live > max_residency) { max_residency = live; } @@ -459,7 +458,6 @@ stat_endGC (Capability *cap, gc_thread *gct, traceEventHeapLive(cap, CAPSET_HEAP_DEFAULT, live * sizeof(W_)); - } if (slop > max_slop) max_slop = slop; } }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8504 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8504: Provide minor GC residency estimates -------------------------------+------------------------------------------- Reporter: ezyang | Owner: simonmar Type: feature | Status: new request | Milestone: Priority: lowest | Version: 7.7 Component: Runtime | Keywords: easy System | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 hour) Operating System: | Blocked By: Unknown/Multiple | Related Tickets: Type of failure: | None/Unknown | Test Case: | Blocking: | -------------------------------+------------------------------------------- Comment (by simonmar): I'm not against having a higher resolution but lower accuracy residency sample, but it should be something that has to be requested explicitly (I presume your patch above isn't a serious proposal, but just to be clear I don't think it would be a good idea to apply it!). The residency you'll see by using the figures from minor collections is the saw-tooth generational GC pattern. That's fine if you understand why, but we don't want to give users the mistaken impression that their programs have a saw-tooth heap profile. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8504#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC