Archived:Small default stack size in S60 3rd Edition (Known Issue)

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The default stack size in S60 3rd Edition is only 8 kB, which may not be enough for more complex applications.

Article Metadata
Platform(s): S60 3rd Edition
S60 3rd Edition (initial release)
Created: User:Technical writer 1 (21 Aug 2007)
Last edited: hamishwillee (19 Jun 2012)


With Symbian OS v9, the default stack size was reduced from 20 kB to 8 kB to optimize memory consumption because platform security caused an increase in the number of running processes in the system.

In practice, the 8 kB stack has proven to be quite small for any larger S60 application. Even if the stack size were sufficient when the application is run on current devices, there is an increased risk of crashes due to stack overflow in future S60 3rd Edition devices as new features can cause a slight increase in stack consumption of the platform libraries. Thus, using a too small size for the stack endangers also binary compatibility.

Increasing the stack size to 20 kB is recommended for all applications written with the S60 3rd Edition SDK. Applications need to be recompiled in order to modify the stack size.
The maximum user thread stack size is 0x14000 ~ 80K.

The maximum stack size per process is 0x200000 ~ 2MB.


Stack sizes other than the default 8 kB can be configured with the epocstacksize statement in the .mmp project definition file.

epocstacksize stacksize

The size of the stack, in bytes, can be specified in decimal or hexadecimal format. Using this statement will have no effect under the WINSCW/WINS platforms.

For example, adding the following line to the .mmp file will increase the stack size to 20 kB:

epocstacksize 0x5000

Alternatively, stack size can be defined for a new thread when creating the thread.

This page was last modified on 19 June 2012, at 11:11.
43 page views in the last 30 days.