MemoryHeap::LimitHandler::OnExceedLimit

MemoryHeap::LimitHandler::OnExceedLimit
virtual bool OnExceedLimit(MemoryHeap* heap, UPInt overLimit) = 0;
Description

OnExceedLimit is called when the limit on memory as set in HeapDesc is reached and the handler tries to free memory of at least "overLimit" size in summary (release cached elements, invoke GC, etc). If freeing is not possible or there is not enough size of elements, the method can increase the memory limit by calling SetLimit. In both these cases, the method should return true. If neither is possible, the method returns false and the allocation call fails (returns 0).

Parameters
Parameters 
Description 
MemoryHeap* heap 
Memory heap which has exceeded the limit. 
UPInt overLimit 
Amount of bytes of memory that is tried to be released in the memory heap. 
Return Value

Returns true if SetLimit is called and the limit is increased; false if freeing of memory or increasing memory limit fails.