How to increase stack size of application

Login to reply to this topic.
Thu, 2004-11-04 06:54
Joined: 2004-09-27
Forum posts: 122
Hi All,
I have portes an application on Symbian series 60 platform using  ver 7.0s Series60_v21. My application handle bigger data area so when it execute on hardware it crashes but it works fine on emulator.

I want to increase stack size of any example file given with SDK. So How to increase the stack size.

Hoping ur reply...
thanks & rgds
chandrashekhar

Thu, 2004-11-04 10:30
Joined: 2004-07-28
Forum posts: 1379
How to increase stack size of application
epocstacksize in your MMP.

Just a note - I wouldn't - the stack size is small for a reason.

didster

Thu, 2004-11-04 10:56
Joined: 2004-09-27
Forum posts: 122
How to increase stack size of application
Hi dude,
I have added a line in my mmp file as follows but and given its size but it seems no effect

SRCDBG
OPTION GCC  -save-temps
epocstacksize   16000
TARGET            proj.app
TARGETTYPE        app
UID               0x100039CE 0x102045A9
TARGETPATH        \system\apps\proj

SOURCEPATH        ..\src
SOURCE            Proj.cpp
SOURCE            ProjApplication.cpp
SOURCE            ProjAppView.cpp
SOURCE            ProjAppUi.cpp
SOURCE            ProjDocument.cpp



Is it correct or have another way to do ?

Thanks alot.
chandrashekhar
Thu, 2004-11-04 11:11
Joined: 2004-07-28
Forum posts: 1379
How to increase stack size of application
Try rounding it up to 8K blocks - epocstacksize 16384 for 16k.

didster

Thu, 2004-11-04 11:28
Joined: 2004-09-27
Forum posts: 122
How to increase stack size of application
Hi,
Thanx for reply, i have used rounded value only as follows but still it does not solved my problem.

UID               0x100039CE 0x102045A9
TARGETPATH        \system\apps\proj

EPOCSTACKSIZE 65536

thanx
Thu, 2004-11-04 11:32
Joined: 2004-07-28
Forum posts: 1379
How to increase stack size of application
In which case, I'm affraid I don't know.

It's not something people do that often for good reason Smiley

What exactly is your problem?  How do you know it is the stack overflowing?

didster

Thu, 2004-11-04 11:41
Joined: 2004-09-27
Forum posts: 122
How to increase stack size of application
As i have said that  my application converts midi file format to PCM data format so when i am asking to generate more tunes(polyphony) then it creshes , if i am using less tunes (polyphony)then it works fine on target.
That why i guess that it might that it crashes because of stack overflow.

Thanx alot
Thu, 2004-11-04 16:07
Joined: 2004-02-05
Forum posts: 176
How to increase stack size of application
ItÂ’s been awhile since I have had to muck with this, but I believe the epocstacksize flag in the mmp file only allows you to adjust the size of the stack for an exe and not for an app.  This has to do with how apps are launched using apprun.exe.

There are a couple things you can do

A) Try to get as much on the heap as you can
B) Put the conversion code into its own thread in the application, you can manually adjust the size of the stack in a thread using RThread::Create.  Note: I didn't suggest you actually use threads, merely that it would allow you a means to adjust the stack size. Wink
C) Move the conversion code into an executable and come up with a scheme for your application to call the executable for the conversion and wait for it (using a global semaphore or file system notifier, or other methods)

These are just ideas...

If possible, A) is probably the easiest of the above; it depends on your code size

One example of "C" working is Peter Yipton's UIQ port to Doom, which you can find on http://www.yipton.net/ .  

Anyhow, good luck
Darin

Fri, 2004-11-05 03:54
Joined: 2004-09-27
Forum posts: 122
How to increase stack size of application
Hi,
Actually u r right to have another thread for data coversion application and through global flag or other mechanism we have to check if data has generated.

But according to Simbian manual as they suggest try to avoid using multi thread because it is little  slow and resource consuming. That why i have implemented in single thread  as exmple code and integrated my application.
>>I believe the epocstacksize flag in the mmp file only allows you to adjust the size of the stack for an exe and not for an app.

Though manual does not say about adjusting stack size will only effective in exe not in .app but i think u r right.


Do you think active object concept will be better to use in place of another thread ?


Thanks & Rgds
chandrashekhar
Fri, 2004-11-05 16:50
Forum Nokia Champion
Joined: 2003-10-01
Forum posts: 721
How to increase stack size of application
Hi,

Is it possible to split these files to smaller pieces? That way, you wouldn't have to allocate too much memory for the whole data. I don't know if this suggestion makes sense, because I don't know MIDI and PCM file formats.

Cheers,

tOtE

Gabor Torok
Software architect, Agil Eight (http://www.agileight.com/)
Blog: http://mobile-thoughts.blogspot.com/

Mon, 2004-11-08 03:08
Joined: 2004-09-27
Forum posts: 122
How to increase stack size of application
Hi,
Can any one know how much max stack size i can set in mmp file which will be allocated by target(series  60). I have heard that max allowed stack size is 16 KB even if setting 32 KB in mmp file. On actual target OS will only provide max 16 KB memory for stack to any application.

Do any one make me clear... Roll Eyes

Thanks & Rgds
chandrashekhar
  • Login to reply to this topic.