Mempry allocation problem with RTEMS 4.0.0

Joel Sherrill joel.sherrill at OARcorp.com
Mon Sep 18 15:13:49 UTC 2000


"Alexander D. Tarkhov" wrote:
> 
> Hello, all!
> 
> We have been using RTEMS ver. 4.0.0 for more than a year now,
> but recently encountered a memory allocation problem.
> We can not get more than ~50kb total memory even if we start to allocate
> it by small blocks (~1kb).
> When we use "new" for allocation
> new buffer[1024];
> it crashes down after total amount reaches ~46kb.
> And when we use "malloc"
> buffer = malloc(1024);
> it simply returns NULL after about 50 calls.

Look deep in the bowels of the BSP for a call that initializes
the C library and/or malloc.  The call to RTEMS_Malloc_Initialize
is passed the size of the heap.  Many BSPs had a hard-coded 
64K and did not calculate it based on memory available on the
board.  The m68k BSPs have some special support in the linker
script to do this.

> Target: mips64orion p4650, 2Mb memory
> Host: FreeBSD
> 
> There seems to be some problem with heap initialization,
> or CONFIGURE_EXECUTIVE_RAM_SIZE parameter is not used correctly.

Correct on heap initialization. 

CONFIGURE_EXECUTIVE_RAM_SIZE is strictly for executive memory
(tasks, stacks, etc.)

> What do you think about this problem and how can we overcome this issue?
> Thank you in advance.
> 
> Alexander Tarkhov

-- 
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