mimalloc icon indicating copy to clipboard operation
mimalloc copied to clipboard

Reconsider the switch to MADV_FREE by default in v2.1.2?

Open jberryman opened this issue 2 years ago • 0 comments

We're exploring using mimalloc for it’s “eager page purging”, i.e. We noticed that memory usage as reported by top (RSS), looks much more sensible, where previously it would remain high With the only remaining explanation being behavior of malloc ( some combination of fragmentation and caching of free blocks). We are not experts in C or allocators.

I noticed that between v2.1.1 and v2.1.2 the memory behavior of mimalloc in our application seems to change dramatically ( memory usage stays high). I think this is due to 0bb5cecbc28 .

For context, as far as I know all or most of our users monitor memory usage by looking at some version of the RSS value that top is reporting. I don't know how to properly monitor “real” memory usage vis-à-vis MADV_FREE, but even if that is straightforward, we have no say in how our users monitor the application, and so we need to adapt to them, even if it means a small performance hit.

my understanding of the issues here are limited to where it has been discussed in the context of Haskell, which you can read about here if you want:

https://gitlab.haskell.org/ghc/ghc/-/issues/17411 https://gitlab.haskell.org/ghc/ghc/-/issues/19551

jberryman avatar Jul 05 '23 15:07 jberryman