×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    18

    what is the maximum amount of stack size ?

    i am trying to set stack size with EPOCSTACKSIZE 0x5000.
    But it seems there is nothing happens (i use RThread.GetRamSizes to know available stack size).

    What must i do to increase stack size ?
    What is the maximum amount of stack size which can i set in EPOCSTACKSIZE?

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Smile Re: what is the maximum amount of stack size ?

    Hello dear,

    I have read somewhere that default size of stack is 8 KB.

    Following link may help u.
    http://descriptors.blogspot.com/

    Regards.
    Kiran.

  3. #3
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: what is the maximum amount of stack size ?

    hi,
    Code:
    Small default stack size in S60 3rd Edition
    
    KIS000387
    Overview
    
    The default stack size in S60 3rd Edition is only 8 kB, which may not be enough for more complex applications.
    Reported against
    
    S60 3rd Edition
    Date identified
    
    July 7, 2006
    Symptoms
    
    -
    Detailed 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.
    How to reproduce
    
    -
    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.
    Regards,
    Mateen Maldar
    "Whatever the mind can conceive and believe, the mind can achieve"

  4. #4
    Registered User
    Join Date
    Aug 2006
    Posts
    18

    Re: what is the maximum amount of stack size ?

    Thanks for information

  5. #5
    Regular Contributor
    Join Date
    May 2006
    Posts
    271

    what is the maximum amount of stack size ?

    Presently i am working 3rd edition 9.1v.how to know the application stack size was incresed more than allocated stack size.
    example in 3rd maximum stack size was 8KB, suppose my application stack size incressed 8kB at the time how i know.

  6. #6
    Super Contributor
    Join Date
    Jun 2006
    Location
    Moscow, Russia
    Posts
    803

    Re: what is the maximum amount of stack size ?

    Hi,

    1) 8 Kb is not the maximum stack size but the default size - see mateen's post below, so if you suspect that you have problems of a little stack size then you can try to increase it.

    2) If it is clear that stack size is exceeded at the compilation time then you just get a linker error, but as I understand this is not your case. You can either try to increase the stack size or not to use stack so exstensively - allocate memory on heap; avoid recursive calls...

    Hope this helps you
    Regards,
    ivey

  7. #7
    Regular Contributor
    Join Date
    May 2006
    Posts
    271

    what is the maximum amount of stack size ?

    ya i know we can able to increase stack size.But problem is not that how i know my application was occupy more than default stack size.

  8. #8
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: what is the maximum amount of stack size ?

    Hi sriramadasu,

    Often you will only find that you have used more stack than you should at run time. On the device it seems you get a KERN-EXEC 3 from your other post (It might have been more helpful if this was implemented as a specific Stack Overflow panic).

    One very easy way to use a lot of stack is with recursive function calls. Another is to allocate very large TBuf's, or a lot of them.

    If you have a problem and making the stack bigger gets rid of it then it is quite likely you had a stack overflow error. Symbian is quite good for this. Some platforms I've worked on didn't have any error when you overflow the stack and you only find out some time later when a bit of memory used by some other code has been changed mysteriously!

    Sorcery

Similar Threads

  1. Audio Input Stream on N80
    By tkaihock in forum Symbian Media (Closed)
    Replies: 9
    Last Post: 2006-06-30, 09:15
  2. Set stack size in S60 emulators?
    By fsiegel in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2005-01-22, 00:56
  3. Maximum record size
    By tomasmcg in forum Mobile Java General
    Replies: 12
    Last Post: 2004-06-22, 10:14
  4. Replies: 0
    Last Post: 2004-03-03, 20:49
  5. exe stack size
    By cbrueckner in forum Symbian
    Replies: 0
    Last Post: 2003-09-12, 11:44

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×