Right it seems like there are a bunch of `getOccupiedMem` in the gc file so that it can get the memory managed, including a [collection threshold](https://github.com/nim-lang/Nim/blob/devel/lib/system/gc.nim#L838).
In my case the shared mem array is only used to hold temporaries for computation (main long-lived data is held in a seq) so I can trigger a manual GC_collect after computation is done, but for non-temporary usage I could get out-of-mem even though enough space can be collected.
