There are several popular crates that let you check the transitive size of an entire object graph, e.g.: 1. https://crates.io/crates/allocative 2. https://crates.io/crates/deepsize 3. https://crates.io/crates/get-size2 We should apply one of these to be able to query memory statistics about the whole index. Then, we can implement the `dsize` function, to expose this memory usage to Ruby, so it can be queried e.g. via [`ObjectSpace.memsize_of`](https://docs.ruby-lang.org/en/master/ObjectSpace.html#method-c-memsize_of). > [!NOTE] > Whichever crate we end up using, we should make sure it can deal with shared objects (like `Rc`/`Arc`) and doesn't double-count them.
There are several popular crates that let you check the transitive size of an entire object graph, e.g.:
We should apply one of these to be able to query memory statistics about the whole index.
Then, we can implement the
dsizefunction, to expose this memory usage to Ruby, so it can be queried e.g. viaObjectSpace.memsize_of.Note
Whichever crate we end up using, we should make sure it can deal with shared objects (like
Rc/Arc) and doesn't double-count them.