snmalloc icon indicating copy to clipboard operation
snmalloc copied to clipboard

allocator purge exposure ?

Open devnexen opened this issue 3 years ago • 1 comments

jemalloc provides the ability to purge a specific arena via mallctl with the oid 'arena.[id].purge', so I was wondering if the feature closest to it would be LocalAllocator::flush() (or literally teardown in the upper level) and it was a good idea to expose such capability as C symbol ?

devnexen avatar Dec 01 '21 10:12 devnexen

The nearest bit is https://github.com/microsoft/snmalloc/blob/b1da339b3e57fe8fdf5dc2a3c0cb30fb2ea993c2/src/mem/chunkallocator.h#L147-L178 This on a timer pushes unused chunks of memory back into central pools and decommits them.

I want to get LowMemory notifications to call a modified version of this.

Your question makes me think that teardown should also interact with this code, and I don't think it currently does. I am deep in a concurrency issue on Verona at a moment, but can think this through tomorrow.

mjp41 avatar Dec 01 '21 11:12 mjp41