Relation between dynamic and memory fragmentation

Status
Not open for further replies.

JaMe

Junior Member level 1
Joined
Nov 8, 2006
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Indonesia
Activity points
1,406
what is the relation between dynamic and memory fragmentation ? Is something like that could occur in AVR microcontroller?
 

Hi

If you mean Dynamic allocation , yes
Dynamic allocation will lead to memory fragmentation.
and you need a garbage collector .
to avoid this you can use memory pools with different sizes to make allocation from.

Regarding AVR I don't know , but basically it could happen.
In Embedded Systems program should work for ever so memory fragmentation could happen with hi probability, it's better to calculate your memory needs before compiling your code and allocate your memory staticalley.

Salam
Hossam Alzomor
www(.)i-g(.)org
 

    JaMe

    Points: 2
    Helpful Answer Positive Rating
Dynamic memory allocation happens on the heap.
As a microcontroller has no inherent OS, the heap will only exsist if you create it in code and use dynamic memory algorythms. Unless you are using an RTOS or OS, you have control over the memory.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…