Embodiments of the present invention provide a mechanism for an operating
system and applications to cooperate in memory management. Applications
register with the operating system for cooperative memory management. The
operating system monitors the memory and determines a memory "pressure"
related to the amount of demand for the memory. As the memory pressure
increases, the operating system provides a memory pressure signal as
feedback to the registered applications. The operating system may send
this signal to indicate it is about to commence evicting pages from the
memory or when it has commenced swapping out application data. In
response to the signal, the registered applications may evaluate the
memory pressure, determine which data should be freed, if any, and
provide this information back to the operating system. The operating
system may then free those portions of memory relinquished by the
applications. By releasing data the system may thus avoid swapping and
increase its performance.