TIL someone added a Linux kernel "feature" to let any process in same cgroup steal contents of freed memory. https://lkml.org/lkml/2012/1/18/308 …
It only works with a malloc that uses MAP_UNINITIALIZED and MADV_DONTNEED (maybe jemalloc?), but presumably they use this...
-
-
Only Facebook's internal jemalloc uses MAP_UNINITIALIZED.
-
Note the patch is from Facebook. MADV_FREE landed upstream now though. Shouldn't have nearly as much need for this stuff now.
-
MADV_FREE doesn't drop any pages. It only marks the range as reclaimable. Then drops them when under memory pressure.
-
It relies on dirty bit to know if the pages were written to. Means uninit data can be odd even without optimizing compilers.
-
i.e. uninitialized malloc memory can start as non-zero and then become zero, if malloc marked that memory with MADV_FREE.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.