Thread Subject: How to increase the stack space available for MATLAB

Subject: How to increase the stack space available for MATLAB

From: Amogh Rajanna

Date: 17 Apr, 2008 08:58:02

Message: 1 of 5

Hello Everyone,

How to increase the stack space available for MATLAB.
The programs that i am running have lots of recursive
function calls. Currently the maximum recursion limit is
set to 500.
I want to increase the maximum recursion limit but before
that i must increase the stack space available for MATLAB.
Does anybody have an idea how to do it?
Please reply if anybody has a solution.

Thanks
Amogh Rajanna

Subject: How to increase the stack space available for MATLAB

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 17 Apr, 2008 13:37:39

Message: 2 of 5

In article <fu73eq$n6i$1@fred.mathworks.com>,
Amogh Rajanna <amoevol@yahoo.co.in> wrote:
>I want to increase the maximum recursion limit but before
>that i must increase the stack space available for MATLAB.
>Does anybody have an idea how to do it?

The method of increasing the stack space depends upon your
operating system, which you did not mention.

>Currently the maximum recursion limit is set to 500.

The recursion limit is built in to Matlab, independant of the
stack space. You are probably not running out of stack memory:
you are probably running into a built-in Matlab counter.
--
   "Any sufficiently advanced bug is indistinguishable from a feature."
   -- Rich Kulawiec

Subject: How to increase the stack space available for MATLAB

From: Amogh Rajanna

Date: 18 Apr, 2008 02:13:03

Message: 3 of 5

The OS i am using is Windows Vista.
2GB RAM.

How to increase stack space available for MATLAB in Windows
Vista??

Thanks
Amogh


roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <fu7jr3$3e3$1@canopus.cc.umanitoba.ca>...
> In article <fu73eq$n6i$1@fred.mathworks.com>,
> Amogh Rajanna <amoevol@yahoo.co.in> wrote:
> >I want to increase the maximum recursion limit but
before
> >that i must increase the stack space available for
MATLAB.
> >Does anybody have an idea how to do it?
>
> The method of increasing the stack space depends upon your
> operating system, which you did not mention.
>
> >Currently the maximum recursion limit is set to 500.
>
> The recursion limit is built in to Matlab, independant of
the
> stack space. You are probably not running out of stack
memory:
> you are probably running into a built-in Matlab counter.
> --
> "Any sufficiently advanced bug is indistinguishable
from a feature."
> -- Rich Kulawiec

Subject: How to increase the stack space available for MATLAB

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 18 Apr, 2008 18:11:09

Message: 4 of 5

In article <fu903f$3ll$1@fred.mathworks.com>,
Amogh Rajanna <amoevol@yahoo.co.in> wrote:
>The OS i am using is Windows Vista.
>2GB RAM.

>How to increase stack space available for MATLAB in Windows
>Vista??

I don't know about Vista, but I found the following:

http://msdn2.microsoft.com/en-us/library/35yc2tc3(VS.80).aspx

That's the DOS/Windows command EDITBIN with the /STACK option.


Don't be surprised if it doesn't help at all. When your program
bombs out telling you your stack is too deep at -exactly- 500 levels,
you can be sure that the 500 number is programmed into Matlab, not just
chance that -exactly- 500 calls fit into the stack. And as best
I *recall*, Mathworks has said there is no way for the user to increase
the built-in recursion limit.
--
Q: Why did the chicken cross the Mobius strip?

A: There were manifold reasons.

Subject: How to increase the stack space available for MATLAB

From: Steven Lord

Date: 18 Apr, 2008 19:15:43

Message: 5 of 5


"Walter Roberson" <roberson@ibd.nrc-cnrc.gc.ca> wrote in message
news:fuao7t$2e$1@canopus.cc.umanitoba.ca...
> In article <fu903f$3ll$1@fred.mathworks.com>,
> Amogh Rajanna <amoevol@yahoo.co.in> wrote:
>>The OS i am using is Windows Vista.
>>2GB RAM.
>
>>How to increase stack space available for MATLAB in Windows
>>Vista??
>
> I don't know about Vista, but I found the following:
>
> http://msdn2.microsoft.com/en-us/library/35yc2tc3(VS.80).aspx
>
> That's the DOS/Windows command EDITBIN with the /STACK option.
>
>
> Don't be surprised if it doesn't help at all. When your program
> bombs out telling you your stack is too deep at -exactly- 500 levels,
> you can be sure that the 500 number is programmed into Matlab, not just
> chance that -exactly- 500 calls fit into the stack. And as best
> I *recall*, Mathworks has said there is no way for the user to increase
> the built-in recursion limit.

We give you the ability to point the recursion gun at your foot if you so
choose.

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/rootobject_props.html#RecursionLimit

The default RecursionLimit value is 500 for all platforms except I believe
32-bit Linux, where it's set lower because I think we had problems in the
past.

--
Steve Lord
slord@mathworks.com

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com