summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2018-05-28 09:59:55 +0300
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2018-05-28 10:00:04 +0300
commita5446c4501cf30aa06eab636823d031bb98db739 (patch)
tree862e76ac67a0470f3a8cb90edddd126b34803ea7
parentb67e8a3f107f7e7b2cefb526a5f956a4a3abc852 (diff)
downloadhaskell-a5446c4501cf30aa06eab636823d031bb98db739.tar.gz
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
-rw-r--r--includes/RtsAPI.h7
-rw-r--r--libraries/base/GHC/Stats.hsc7
2 files changed, 10 insertions, 4 deletions
diff --git a/includes/RtsAPI.h b/includes/RtsAPI.h
index 69ec6075db..79c4d8ef53 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 d81173fe58..58b5e22d04 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