Tuesday, 5 April 2016

Fixed block memory allocation is preferred than dynamic memory allocation during memory management of RTOS. Why?

Three top reasons:

 1) In fixed block memory allocation, size of allocated memory (number of blocks and size of each block) is known to compiler and user (ex. Array[100]). So once a process completes job, allocated memory blocks are released completely If Embedded system uses dynamic memory allocation, it may not free up all the allocated memory in specified order and some portion of memory is lost. This memory loss may add up and cause huge loss to system with small RAM memory (ex. 8051, 128 Bytes)

2) Embedded system cannot afford to run De-fragmentation tool to free fragmented memory since this may cause to shut down the system (during RAM fragmentation) which may lead to catastrophic results.

3) Dynamic memory allocation brings non-deterministic behavior of system since time taken for memory allocation cannot be decided before-hand (varies by different memory block size) and this is not accepted in Embedded systems. 

No comments:

Post a Comment