Friday, May 16, 2008

Symbian OS Heaps

Each Symbian application the default Symbian OS RHeap implementation.



Symbian OS heaps are implemented using a chunk. A chunk is a wrapper around a collection of pages of memory. The minimum size for a chunk is one page of RAM and this is typically 4 KB.



When a process is created, a default heap is created for the main thread of execution within that process. And this heap has maximum size that a process is allowed to grow in the usage of RAM. If it goes beyond that upper limit, memory allocation will fail with KErrNoMemory.



Process Startup:


When the main thread starts
, Symbian OS E32 Process startup framework creates a chunk in which the heap for the process will live.



if your process is called “ProA”, your thread is called “Thr1”, then full name associated with your heap chunk is “ProA::Thr1::$HEAP.”



Once the chunk is created by the kernel and is mapped into the process , an RHeap object is then allocated in-place at the start of the chunk. Then the heap object is configured with the sizing information from the E32 image header. This object is used to find out the sizes of allocated and unallocated in a chunk / Heap.

Symbian OS process heaps can be extended using some slack spaces by adding some free cells at the end of the chunk.



0 comments:

 
Template design by Amanda @ Blogger Buster