A client that wishes to be notified of low memory situations (for example, because the client maintains a large memory cache that could be released when memory is tight) should register with the observer service (see nsIObserverService) using the topic "memory-pressure". There are three specific types of notications that can occur. These types will be passed as the |aData| parameter of the of the "memory-pressure" notification:
"low-memory" This will be passed as the extra data when the pressure observer is being asked to flush for low-memory conditions.
"heap-minimize" This will be passed as the extra data when the pressure observer is being asked to flush because of a heap minimize call.
"alloc-failure" This will be passed as the extra data when the pressure observer has been asked to flush because a malloc() or realloc() has failed.
Public Member Functions
|voidPtr||alloc (in size_t size)|
|void||free (in voidPtr ptr)|
|void||heapMinimize (in boolean immediate)|
|voidPtr||realloc (in voidPtr ptr, in size_t newSize)|
|NS_IMETHOD_ (nsrefcnt) Release(void)=0|
|NS_IMETHOD_ (nsrefcnt) AddRef(void)=0|
|NS_IMETHOD||QueryInterface (REFNSIID aIID, void **aInstancePtr)=0|