Conversation

Is there a way to tell kernels “I’m done with this addr space, don’t recycle it and fault me if I access it, but don’t actually keep the page around”? Maybe madvise+mprotect? It would make for cheap use-after-free detection at the cost of eventually running out of address space.
10
28
And really, if you are never going to use it again, MADV_DONTNEED is better than MADV_FREE. You are going to pay the cost of dropping and zeroing the pages anyway, and you don't take advantage of not needing to fault them in again when reusing before memory pressure wipes it out.
1
This Tweet was deleted by the Tweet author. Learn more
Show replies