`gc.heapSize` is subject to rounding on the order of MBs
Is your feature request related to a problem?
It's hard to observe changes in the collectability of heap objects with NIX_SHOW_STATS.
gc.heapSize would be the measurement for this, but it is too coarse grained, and doesn't accurately reflect heap changes due to changes in expressions.
We're using this (through the _safe call instead):
Includes empty blocks and fragmentation loss. Includes some pages that were allocated but never written.
https://github.com/ivmai/bdwgc/blob/9e224cb87759c1ca420a5cd5c6082d29b9ed58cb/include/gc/gc.h#L780-L793
Proposed solution
Dig through the stats, and/or the code that produces it to figure out if we can get a better number that measures memory retention in a more fine grained manner.
Alternative solutions
Additional context
Checklist
- [ ] checked latest Nix manual (source)
- [ ] checked open feature issues and pull requests for possible duplicates
Add :+1: to issues you find important.
It would also be good to have separate stats for max heap size and final heap size, if possible.