<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - comments on Post, stack limit</title>
    <link>http://www.mapleprimes.com/posts/43772-Stack-Limit</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Thu, 11 Jun 2026 06:40:43 GMT</lastBuildDate>
    <pubDate>Thu, 11 Jun 2026 06:40:43 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest comments added to the Post, stack limit</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - comments on Post, stack limit</title>
      <link>http://www.mapleprimes.com/posts/43772-Stack-Limit</link>
    </image>
    <item>
      <title>Stack limits</title>
      <link>http://www.mapleprimes.com/posts/43772-Stack-Limit?ref=Feed:MaplePrimes:stack limit:Comments#comment80774</link>
      <itunes:summary>I can't help you too much with the GOT problem as I am not very familar with it.  It looks like you may have found a bug, rather than an acutal problem with stack limits.

However, I can explain how stack limits should work.

First, Windows and Unix are different.  On windows the maximum stack limit is a fixed constant.  This constant is the value you identified as max in your chart.  We increased this constant in Maple 10, which is why the value you found is much larger than for previous versions.  You can lower the stack limit in Maple.

On unix, the hard stack limit is set as part of the system configuration.  Many shared unix boxes will set limits to keep one user from using all the system resources.  However on many desktop linux boxes these limits are not set.  It appears your linux machine does not have a hard stack limit set (or it is set to "infinity").  However you may still have a soft stack limit.  A soft limit still limits the amount of stack space a process can use, but it can be adjusted by the user (up to the hard limit).  When you set the stacklimit in Maple you are adjusting the soft limit.

On linux you can read the "ulimit" section of the bash/sh man page or the "limit" section of the tcsh/csh man page for more information on resource limits.

These limits are independent of the amount of RAM on the system.  They can be set to whatever you like.  However if they are set too large, a poorly written or malicious program could consume all the resources of the system and effectively halt the machine.  The stack limits you describe are in kibibytes so a limit of 2937000 is almost 3 Gigs of memory.

As for the error messages, (1) is basically an improved version of (4).  (2) and (3) are bugs.  Those cases should be printing (1).

One generally does not need a large stack limit.  Unless you are running very recusive functions, the default limits are usually fine.

Darin

--
Kernel Developer
Maplesoft</itunes:summary>
      <description>The latest comments added to the Post, stack limit</description>
      <guid>80774</guid>
      <pubDate>Fri, 05 Aug 2005 22:41:38 Z</pubDate>
      <itunes:author>dohashi</itunes:author>
      <author>dohashi</author>
    </item>
    <item>
      <title>Stack limits</title>
      <link>http://www.mapleprimes.com/posts/43772-Stack-Limit?ref=Feed:MaplePrimes:stack limit:Comments#comment86929</link>
      <itunes:summary>&lt;p&gt;Yes, these stacklimit figures are from personal (nonshared) linux boxes. &lt;strong&gt;ulimit&lt;/strong&gt; figures for the RH7.1 box with 1GB RAM are:&lt;/p&gt;
&lt;pre&gt;ulimit -a
core file size (blocks)     1000000
data seg size (kbytes)      unlimited
file size (blocks)          unlimited
max locked memory (kbytes)  unlimited
max memory size (kbytes)    unlimited
open files                  1024
pipe size (512 bytes)       8
stack size (kbytes)         8192
cpu time (seconds)          unlimited
max user processes          32767
virtual memory (kbytes)     unlimited
&lt;/pre&gt;
&lt;pre&gt;ulimit -H 
unlimited 

ulimit -S 
unlimited
&lt;/pre&gt;
&lt;blockquote&gt;&lt;cite&gt; These limits are independent of the amount of RAM on the system. They can be set to whatever you like. However if they are set too large, a poorly written or malicious program could consume all the resources of the system and effectively halt the machine. The stack limits you describe are in kibibytes so a limit of 2937000 is almost 3 Gigs of memory. &lt;/cite&gt;&lt;/blockquote&gt;
&lt;p&gt;So, if I understand correctly there is an "afordable limit" say, determined the amount of RAM and the size of the swap partition, I guess.&lt;/p&gt;
&lt;p&gt;Then for 1GB RAM and 1GB swap, what maximum value for stacklimit would you suggest? It seems that default limits are not fine for GOT calculations above some size. I would set limits as high as possible if that allows the calculations to be done (within a few hours).&lt;/p&gt;</itunes:summary>
      <description>The latest comments added to the Post, stack limit</description>
      <guid>86929</guid>
      <pubDate>Sat, 06 Aug 2005 03:46:34 Z</pubDate>
      <itunes:author>jakubi</itunes:author>
      <author>jakubi</author>
    </item>
    <item>
      <title>Probably not a stack limit problem</title>
      <link>http://www.mapleprimes.com/posts/43772-Stack-Limit?ref=Feed:MaplePrimes:stack limit:Comments#comment90121</link>
      <itunes:summary>I still suspect that the problem you are having is not a stack limit issue.  Instead it looks to me that you have found a bug in Maple or GOT, which I would suggest you report to support.  If it is a bug, adjusting the stack limit will not help you solve the problem.

In case it is a stack limit problem, you can disable the stacklimit check by setting stacklimit=infinity.  If you do this Maple will not be able to catch stacklimit problems and the kernel will simply crash when it runs out of stack space.

&lt;CITE&gt;
So, if I understand correctly there is an "afordable limit" say, determined the amount of RAM and the size of the swap partition, I guess.
&lt;/CITE&gt;

It is also determined by the risk of something going wrong.  On a single user machine like yours I think the risk is relatively low.  I would not change the system limits.  In Maple, I'd used the default unless I had some code that would not complete.  The "too many levels of recursion" message is how Maple usually reports stack limit problems.  The error you received is also a possibility, although that message can also mean something else went wrong.

Darin

--
Kernel Developer
Maplesoft
</itunes:summary>
      <description>The latest comments added to the Post, stack limit</description>
      <guid>90121</guid>
      <pubDate>Mon, 08 Aug 2005 17:25:03 Z</pubDate>
      <itunes:author>dohashi</itunes:author>
      <author>dohashi</author>
    </item>
    <item>
      <title>monitor stack usage</title>
      <link>http://www.mapleprimes.com/posts/43772-Stack-Limit?ref=Feed:MaplePrimes:stack limit:Comments#comment90123</link>
      <itunes:summary>I wonder whether it is possible to monitor the stack usage along a calculation. I think that it might be useful e.g. to identify code problems and to stop calculations before they reach the limit.

Alejandro

</itunes:summary>
      <description>The latest comments added to the Post, stack limit</description>
      <guid>90123</guid>
      <pubDate>Tue, 09 Aug 2005 04:39:06 Z</pubDate>
      <itunes:author>jakubi</itunes:author>
      <author>jakubi</author>
    </item>
    <item>
      <title>one way to look at Stack size</title>
      <link>http://www.mapleprimes.com/posts/43772-Stack-Limit?ref=Feed:MaplePrimes:stack limit:Comments#comment90334</link>
      <itunes:summary>i am having a similar problem with stack limits; the way i am able to see the stack size increasing is from the "Task Manager" in WinXP. look at the "PF Usage" in Performance tab. this might help.

but it appears to me that somehow even inside a simple for loop some stuff is being put on a stack (even when there are no recursive calls; looks like a bug to me). the problem is worse in Maple 9 and 10; maple 8 is managing it better (will crash after some more time; but at least better than 9 and 10).</itunes:summary>
      <description>The latest comments added to the Post, stack limit</description>
      <guid>90334</guid>
      <pubDate>Fri, 23 Sep 2005 01:16:39 Z</pubDate>
      <itunes:author>gariki</itunes:author>
      <author>gariki</author>
    </item>
  </channel>
</rss>