Heap Size

Joel Sherrill joel.sherrill at OARcorp.com
Wed Sep 12 17:05:49 UTC 2001

peter.o.mueller at gmx.de wrote:
> Hi all,
> in my linker script I use to following settings for heap and stack:
> ...
> _HeapSize : 0x0;
> _StackSize: 10000;
> ...
> As far as I remember rtems calculates what is left for heap from total mem -
> stack. So the zero is ok. But how can I tune the stack figure. Is the figure
> specified here the total amount of stack for all tasks?

No.  It is just the size of the startup/initialization stack.  10K
is almost certainly at least 5 times too large. :)

> How can I estimate the StackSize? Is it like:
> number of tasks * stack_per_task + what_rtems_needs?

That's basically it.  RTEMS does not need any stack except
what it uses as a normal side-effect of subroutine calls.
The m68k has a dedicated interrupt stack so very little
task context is saved on a task stack on an ISR.

> Peter
> --
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net

Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985

More information about the users mailing list