RT1176 -- memp_ma11oc: out of memory in poo1 NETBUF

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

RT1176 -- memp_ma11oc: out of memory in poo1 NETBUF

1,876件の閲覧回数
linsy
Contributor II

i.MX-RT1170 Hello everybody,

After modifying the memory configuration of RT1176, I encountered a mempma11oc: out of memory in poo1 NETBUF error. I spent two months without finding the problem, please help me find the reason, thank you

992dcec53fd966c769102a019aee24c.jpg

 

c8c96d16483d0ada300ff76b32abf7d.jpg

ed20735e62fde7300078072f9ff0101.jpg

5729deb7e3c39b85797d04664a72f41.png

ba8456394072a2fd349d62c6eeeb619.png

e4e7262810a2c155dd5d5d5b37d3ece.png

c95fb60167fcc52a6d18bfa04d289b6.png

 

 

 

 

ラベル(1)
0 件の賞賛
返信
1 返信

1,851件の閲覧回数
Sam_Gao
NXP Employee
NXP Employee

Hi @linsy 

Hope you are doing well.

I looked up key information about this example you provided and It seems not from NXP offical examples, below coments for your reference to debug, hopt it help you find the root cause.

 

1. Enlarge MEMP_NUM_NETBUF

// Depends on your runtime enviroment 

if (memp_free(MEMP_NETBUF) < 10) {  // 当剩余内存少于10个时
    PRINTF("Increasing NETBUF pool size\n");
    memp_increase(MEMP_NETBUF, 10);  // 增加10个
}

 

2. Check for Memory Leaks
Ensure there are no memory leaks, especially in critical paths where memory is allocated frequently.

Add Memory Allocation Tracking
Add logging to track memory allocations and identify their locations.

void *netbuf = memp_malloc(MEMP_NETBUF);
if (netbuf == NULL) {
    PRINTF("Out of memory allocating NETBUF\n");
} else {
    PRINTF("Allocated NETBUF at %p\n", netbuf);
}

Check Release Conditions

Ensure that memory is released properly when it is no longer needed.

memp_free(MEMP_NETBUF, netbuf);
PRINTF("Freed NETBUF at %p\n", netbuf);

 By adding these logs, you can trace where memory is allocated and ensure that it is released correctly. This will help identify any potential memory leaks in your code.

0 件の賞賛
返信