How to release heap size on IMXRT1062 platform?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to release heap size on IMXRT1062 platform?

跳至解决方案
700 次查看
Edward-Liao33
Contributor I

Hi Sir:

Below is my platform information

Chipset: i.MX RT1060X Processor

OS: FreeRTOS , version V10.3.0

Memory management by file heap_3.c ( pvPortMalloc and vPortFree)

When I call function "vPortFree" at the end of my execution, I do not see the MCU heap being properly released. I think the function is releasing the heap of the RTOS rather than the on the MCU, right?

If yes, how can I release the heap on the MCU? 

EdwardLiao33_0-1686652297784.png

Best Regards

Edward

0 项奖励
回复
1 解答
666 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @Edward-Liao33 ,

Yes, heap3.c use system malloc/free function. It seems IDE can't detect new heap usage data after free().

You can test by below code

 

    pt=pvPortMalloc(0x200);
    *pt=1;
    vPortFree(pt);

 

The heap usage will increase when malloc, but will not decrease after free().

 

Regards,

Jing

在原帖中查看解决方案

0 项奖励
回复
2 回复数
667 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @Edward-Liao33 ,

Yes, heap3.c use system malloc/free function. It seems IDE can't detect new heap usage data after free().

You can test by below code

 

    pt=pvPortMalloc(0x200);
    *pt=1;
    vPortFree(pt);

 

The heap usage will increase when malloc, but will not decrease after free().

 

Regards,

Jing

0 项奖励
回复
659 次查看
Edward-Liao33
Contributor I
I understand, thank you Jing.
0 项奖励
回复