Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
runtime: use MADV_FREE on linux as well #23687
On linux currently sysUnused uses
A potentially faster alternative is
Off the top of my head, there are two ways to support both pre-4.5 and 4.5+ kernels:
Hi all. I wondering if there is any data backing up claims about MADV_FREE actually improving anything.
a) I have not seen any data pointing that it does help (I co-maintain gperftools and over there we're defaulting MADV_FREE to off on Linux).
b) there are numerous questions about implementation of this feature in kernel. First, while it is somewhat cheaper then MADV_DONTNEED, it is not that cheap, since page tables have to be walked and modified. It doesn't get reflected in RSS and thus interaction of this and memory reclaim facility in kernel, especially in settings with heavy usage of control groups isn't trivial. And also defaults about how this memory is preferred compared other memory during reclaim is also not entirely clear.
Since this feature was lobbied by jemalloc folks, maybe there are some Facebook folks involved in golang who do have some data?
I think this ticket should be re-opened. We should either gather and publish the data and see that indeed it helps, or revert defaults to off. IMHO.