Archived:Small default stack size in S60 3rd Edition (Known Issue)
The default stack size in S60 3rd Edition is only 8 kB, which may not be enough for more complex applications.
Article Metadata
Compatibility
Article
Description
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.
Solution
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.


(no comments yet)