release and debug mode heap allocation

Joel Sherrill joel.sherrill at OARcorp.com
Sun May 25 09:38:25 UTC 2008


Aleix Conchillo Flaqué wrote:
> By the way, with heap, I meant the RTEMS workspace area which is the
> one passed to _Heap_Allocate and the one related to RTEMS internals.
>
> #define _Workspace_Allocate( _size ) \
>    _Heap_Allocate( &_Workspace_Area, (_size) )
>
>   
Usually this is either because you haven't completely accounted
for all task stack or message buffer memory in your application or
there is an error in confdefs.h which results in an underestimate
of the memory required.

Are all your task stacks of minimum size?

Is the error something like "out of memory"
> On Tue, May 27, 2008 at 1:03 PM, Aleix Conchillo Flaqué
> <aconchillo at ieec.cat> wrote:
>   
>> Hi all,
>>
>> I am experiencing a strange memory allocation behavior when running my
>> application in release and debug modes.
>>
>> I have added some prints in the _Heap_Allocate routine to see what's going on:
>>
>> * release mode: number of calls: 2033 - total size allocated: 853124
>> * debug mode: number of calls: 2035 - total size allocated: 884732
>> <--- if ( the_block == _Heap_Tail( the_heap ) ) FAILS in last call!
>>
>> Increasing the number of tasks (CONFIGURE_MAXIMUM_TASKS), solves the
>> problem in debug mode, and I get:
>>
>> * debug mode: number of calls: 2041 - total size allocated: 892504
>>
>> And in fact, I can not set the exact number of tasks (plus IDLE and
>> initialisation) to CONFIGURE_MAXIMUM_TASKS, even in release mode. So,
>> the release  mode suffers from the same problem when I decrease the
>> number of tasks. Thus, I always need to increase the number of tasks,
>> so there is enough heap.
>>
>> Does this makes any sense?
>>
>> Btw, RTEMS 4.6.6 here.
>>
>> Aleix
>>
>>     
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>   


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