FatFS/Chibios Heap Memory Fragmentation

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

FatFS/Chibios Heap Memory Fragmentation

Post by Tabulous »

just discovered this, ive got one fragment of 512 bytes?

ch> mem
core free memory : 102296 bytes
heap fragments : 1
heap free total : 512 bytes

This is caused by calls to f_chdir as this allocates memory from the heap.

In ffconf.h ive got

#define _USE_LFN 3 /* 0 to 3 */
#define _FS_RPATH 1 /* 0 to 2 */


Why would this fragmentation be happening ? and is this something i should worry about ?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: FatFS/Chibios Heap Memory Fragmentation

Post by Giovanni »

It is normal.

Giovanni
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: FatFS/Chibios Heap Memory Fragmentation

Post by Tabulous »

Giovanni wrote:It is normal.

Giovanni


Hi Giovanni,
you says it normal, but is this memory now lost ?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: FatFS/Chibios Heap Memory Fragmentation

Post by Giovanni »

It is not lost, one chunk went from the unused ram to the chain of the free blocks.

Giovanni
Post Reply