LWN.net Logo

Not so sure

Not so sure

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?


(Log in to post comments)

Normally reserved memory, but unuesed?

Posted Mar 23, 2012 18:31 UTC (Fri) by cheako (guest, #81350) [Link]

b doesn't sound too pleasant. Perhaps a process can register the size of memory needed for the task, but that's trying to find a cure for the cure.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds