|
|
|
UIQ 3 provides a new heap allocator, RQikAllocator, which should be used instead of RAllocator.
UIQ has a component called Memory Manager. This component continually observes how much free memory is available. Memory Manager releases memory by shutting down applications that are open in the background so that a certain amount of memory is always available whenever needed. However, when very large chunks of memory are suddenly needed, the background free-up might not be adequate. This could, unnecessarily, cause an out-of-memory error.
In UIQ 3.0 a new heap allocator has been implemented to lessen this problem. What the new heap allocator does is to give Memory Manager a second chance. Instead of generating an out-of-memory error when failing to allocate enough free memory, it will first ask Memory Manager to free up more memory. Once this is done, it will attempt to allocate the required amount of memory again. However, if allocation should fail the second time, an out-of-memory error will be raised.
This means that out-of-memory errors will still occur, but much less often. However, the price to pay for this is possibly sluggish memory allocation when allocation fails on the first try.
For your executable application or component to use the new heap allocator, you need to modify your .mmp file.
NOTE: This applies ONLY to executables, that is, .exe files.
Include these directives in your .mmp file:
LIBRARY QikAllocDll.lib
STATICLIBRARY QikAlloc.lib
That is all you need to do. The new allocator will install itself when your application is loaded, replacing the normal allocator.