Posted Dec 1, 2011 15:57 UTC (Thu) by renox (subscriber, #23785)
Parent article: POSIX_FADV_VOLATILE
> When an application gets a "free up some memory" message, the first thing it will probably need to do is to fault in its code for handling that message - an action which will require the allocation of more memory.
Except for the stack for function calls, that's not necessarily true: the coder know that the goal of the code is to handle 'low memory' condition so a good coder will
a) try to minimize the memory needed for this handling of 'low memory'
b) reserve ahead the memory needed for the task
> Marking the memory ahead of time and freeing it directly from the kernel may turn out to be a more reliable approach.
Uh? Let's say the application has a cache, how could it delegate to the kernel the task to reduce the cache size in 'low memory' condition?