Skip to content

`+RTS -B` doesn't work as advertised, or "bytes maximum residency” from `+RTS -s` doesn't

Maybe a documentation issue. ghc 8.10.1

On our server I'm running with +RTS -B -s and hearing tons of bells and then at the end of the program seeing:

 636,830,752 bytes allocated in the heap
 311,693,168 bytes copied during GC
  68,161,864 bytes maximum residency (11 sample(s))
     577,208 bytes maximum slop
         112 MiB total memory in use (0 MB lost due to fragmentation)

The docs claim:

The maximum space actually used by your program is the “bytes maximum residency” figure. This is only checked during major garbage collections, so it is only an approximation; the number of samples tells you how many times it is checked.

So I'm not sure why only 11 samples were taken or why I heard many more than 11 bells. Maybe it's not checked during every major GC?

I'm sorry I can't subit a repro right now

Edited by jberryman
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information