Join Now
Quality Rating:
  • Currently 1.0 / 5
(1.0 / 5 - 1 vote cast)
Expertise Level:
  • Currently 5.0 / 5
(5.0 / 5 - 1 vote cast)

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:

 
Related Discussions
Thread Thread Starter Forum Replies Last Post
6030 out of memory error 5474N Mobile Java Games 5 2008-05-08 15:40
Nokia 9300 maximum application size salex01 Mobile Java General 3 2006-05-02 00:33
JPG image memory leak? 6280 (Series 60) richtea Mobile Java General 4 2007-04-05 22:19
UHEAP_MARK + UHEAP_MARKEND, When to put? patrick772goh General Symbian C++ 1 2007-12-03 05:20
How to clear the returned CFbsBitmap object in ImageReady whitewinds Symbian Media (Graphics & Sounds) 5 2006-11-29 07:19
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZKnowledgeBaseContentQ
     qfnZtypeQUqfnTypeZTechnicalSolutionQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX