[commit: ghc] master: Update GHC.Stats docs (a5446c4)

git at git.haskell.org git at git.haskell.org
Mon May 28 07:00:24 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/a5446c4501cf30aa06eab636823d031bb98db739/ghc

>---------------------------------------------------------------

commit a5446c4501cf30aa06eab636823d031bb98db739
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date:   Mon May 28 09:59:55 2018 +0300

    Update GHC.Stats docs
    
    Make it clear that max_live_bytes is updated after a major GC whereas
    live_bytes is updated after all GCs (including minor collections) and
    considers data in uncollected generations as live.
    
    Reviewers: bgamari, simonmar, hvr
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D4734


>---------------------------------------------------------------

a5446c4501cf30aa06eab636823d031bb98db739
 includes/RtsAPI.h            | 7 +++++--
 libraries/base/GHC/Stats.hsc | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/includes/RtsAPI.h b/includes/RtsAPI.h
index 69ec607..79c4d8e 100644
--- a/includes/RtsAPI.h
+++ b/includes/RtsAPI.h
@@ -127,7 +127,9 @@ typedef struct GCDetails_ {
   uint32_t threads;
     // Number of bytes allocated since the previous GC
   uint64_t allocated_bytes;
-    // Total amount of live data in the heap (incliudes large + compact data)
+    // Total amount of live data in the heap (incliudes large + compact data).
+    // Updated after every GC. Data in uncollected generations (in minor GCs)
+    // are considered live.
   uint64_t live_bytes;
     // Total amount of live data in large objects
   uint64_t large_objects_bytes;
@@ -165,7 +167,8 @@ typedef struct _RTSStats {
   uint32_t major_gcs;
     // Total bytes allocated
   uint64_t allocated_bytes;
-    // Maximum live data (including large objects + compact regions)
+    // Maximum live data (including large objects + compact regions) in the
+    // heap. Updated after a major GC.
   uint64_t max_live_bytes;
     // Maximum live data in large objects
   uint64_t max_large_objects_bytes;
diff --git a/libraries/base/GHC/Stats.hsc b/libraries/base/GHC/Stats.hsc
index d81173f..58b5e22 100644
--- a/libraries/base/GHC/Stats.hsc
+++ b/libraries/base/GHC/Stats.hsc
@@ -56,7 +56,8 @@ data RTSStats = RTSStats {
   , major_gcs :: Word32
     -- | Total bytes allocated
   , allocated_bytes :: Word64
-    -- | Maximum live data (including large objects + compact regions)
+    -- | Maximum live data (including large objects + compact regions) in the
+    -- heap. Updated after a major GC.
   , max_live_bytes :: Word64
     -- | Maximum live data in large objects
   , max_large_objects_bytes :: Word64
@@ -120,7 +121,9 @@ data GCDetails = GCDetails {
   , gcdetails_threads :: Word32
     -- | Number of bytes allocated since the previous GC
   , gcdetails_allocated_bytes :: Word64
-    -- | Total amount of live data in the heap (incliudes large + compact data)
+    -- | Total amount of live data in the heap (incliudes large + compact data).
+    -- Updated after every GC. Data in uncollected generations (in minor GCs)
+    -- are considered live.
   , gcdetails_live_bytes :: Word64
     -- | Total amount of live data in large objects
   , gcdetails_large_objects_bytes :: Word64



More information about the ghc-commits mailing list