How to release heap size on IMXRT1062 platform?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to release heap size on IMXRT1062 platform?

ソリューションへジャンプ
1,297件の閲覧回数
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 解決策
1,263件の閲覧回数
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 返答(返信)
1,264件の閲覧回数
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 件の賞賛
返信
1,256件の閲覧回数
Edward-Liao33
Contributor I
I understand, thank you Jing.
0 件の賞賛
返信