Does SuperCore use heap ?

Joel Sherrill joel.sherrill at
Tue Jan 13 16:50:33 UTC 2004

Stan wrote:

> Hi,
> I thought SuperCore doesn't use heap, only libc does it ( when routine like
> open, read, write or malloc are called).
  Thus, Workspace is the memory used by RTEMS to allocate objects like tasks
> and semaphores etc...
> But nevertheless, it seems to me that rtems_task_start allocates memory from
> heap.

The workspace is another instance of a super core heap.  There are two
score heaps in a system -- the C program heap and the workspace.

> In my case, I create some tasks :
> rtems_task foo( rtems_task_argument no_argument ){
>     while(1){
>         rtems_task_wake_after( 10 );
>     }
>     rtems_task_delete( RTEMS_SELF );
> }
> For example, after ten successful rtems_task_create , I try to start ten
> tasks.
> If my heap is too small, rtems_task_start cause rtems_fatal_error_occurred
> with code RTEMS_NO_MEMORY.
> Is it normal ?

Yes if you did not reserve enough memory in the workspace.

> Why the memory isn't allocated from the workspace ?

It was until it ran out. :)

> Where is my error ? ;)

I don't see the task create calls but it is possible that you aren't
accounting for all the stack memory you are allocating.  Are they
minimum size or larger?

If they are larger than minimum then you have to account for such.

> [ rtems-4.0.6pre4 ]
> Thanks for you help me.
> Stan.

Joel Sherrill, Ph.D.             Director of Research & Development
joel at                 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