Skip to content

gc.heapSize is subject to rounding on the order of MBs #13336

@roberth

Description

@roberth

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


Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature request or proposallanguageThe Nix expression language; parser, interpreter, primops, evaluation, etc
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions