How to understand the heap usage in mcuxpresso

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to understand the heap usage in mcuxpresso

Jump to solution
1,362 Views
andréluis
Contributor II

Hello. I'm working with freeRtos using MCUxpresso and RT1176. I'm trying to understand how to work with the heap usage of freertos. My question is if below each function, the values ​​allocated after it are related to the function or can be other allocations. For example, in the following image I have two functions and below them is an allocated value and some free values. Are they related to the function? Thank you.

0 Kudos
Reply
1 Solution
1,232 Views
mayliu1
NXP Employee
NXP Employee

Hi @andréluis ,

 

Thanks for your updated information.

The Task TCB is a data structure allocated by FreeRTOS for each task, used to store critical information such as the task's runtime state, priority, stack information, and context.

The "Allocated" refers to heap memory allocated through pvPortMalloc, as well as resources occupied by operating system services (such as semaphores, queues, timers, etc.).

The TCB and "Allocated" are distinct concepts with no direct relationship.

Wish it helps you.
If you still have question about it, please kindly let me know.

Wish you a nice day!

Best Regards
MayLiu

View solution in original post

0 Kudos
Reply
4 Replies
1,300 Views
mayliu1
NXP Employee
NXP Employee

Hi @andréluis ,

 

Thank you so much for your interest in our products and for using our community.

I think your question is related to the FreeRTOS memory management algorithm.

FreeRTOS provides a total of 5 dynamic memory management algorithms, heap_1.c, heap_2.c, heap_3.c, heap_4.c, and heap_5.c.

So could you please check which memory management algorithm is in your project.

I also would like give you a FreeRTOS link to you.

FreeRTOS heap memory management - FreeRTOS™

 

Wish it helps you.
If you still have question about it, please kindly let me know.

Wish you a nice day!

Best Regards
MayLiu

0 Kudos
Reply
1,288 Views
andréluis
Contributor II
Hello Mayliu, how are you? In this case, I don't need to modify the heap. What I need to understand is how this heap usage table works. For example, are the parts that are allocated related to the function in which these allocations are located below in the table? In the image, I have a function called FORTE and right below it it says allocated. In this case, is this allocated related to the FORTE function or is it some other allocation? Thanks.
0 Kudos
Reply
1,233 Views
mayliu1
NXP Employee
NXP Employee

Hi @andréluis ,

 

Thanks for your updated information.

The Task TCB is a data structure allocated by FreeRTOS for each task, used to store critical information such as the task's runtime state, priority, stack information, and context.

The "Allocated" refers to heap memory allocated through pvPortMalloc, as well as resources occupied by operating system services (such as semaphores, queues, timers, etc.).

The TCB and "Allocated" are distinct concepts with no direct relationship.

Wish it helps you.
If you still have question about it, please kindly let me know.

Wish you a nice day!

Best Regards
MayLiu

0 Kudos
Reply
1,197 Views
andréluis
Contributor II
Now i understand MayLiu. Thanks for the help.
0 Kudos
Reply