This page was last modified 11:58, 12 December 2007.
TSS000350 - Heap memory available for an application
From Forum Nokia Wiki
Subject:
| Heap memory available for an application
| TSS000350
|
| Platform(s):
| Device(s), SW version(s):
|
| S60 3rd Edition
|
|
Category:
| Symbian C++
|
Subcategory:
|
|
Description:
| Despite the amount of physical memory available on a given device (or emulated in SDK’s emulator), your application will have access to a limited amount of heap memory. When the process in which your application runs is being created, there will be a small heap pre-allocated to this process. The default value is 4 KB on S60 3rd Edition devices and 1 KB on devices based on earlier versions of the S60 platform. Depending on its needs, the application may freely allocate more heap memory and the amount of heap that the application can use is dynamically increased up to a limit of 1 MB, which is the default upper limit defined by the operating system. An attempt to allocate heap memory that will push the application’s allocated heap size beyond this upper limit would fail with a KErrNoMemory leave. Most Symbian C++ applications can work without problems within this heap memory limit but in some cases the high heap size limit needs to be increased. The lower and upper heap size limits can be specified in the application’s MMP file using the EPOCHEAPSIZE statement. Example: <code> TARGET MemoryTest.exe TARGETTYPE exe UID 0x00000000 KMemoryTestUID3 SECUREID KMemoryTestUID3 VENDORID 0x00000000 CAPABILITY NONE EPOCHEAPSIZE 0x5000 0x400000 EPOCSTACKSIZE 0x5000 .... </code> In the above example the application declares that it needs the lower heaps size limit to be 0x5000 bytes (20 KB) while the upper limit it should be 0x400000 bytes (4 MB). Now this application can safely allocate a block of 3 MB on the heap provided that it has not used already more than 1 MB of heap memory. Note: As documented, prior to S60 3rd Edition the EPOCHEAPSIZE statement has no effect on WINS32 platforms.
|
Creation date:
| July 7, 2006
|
Last modified:
|
|