Am I running out of memory?

zliudr
Posts: 360
Joined: Thu Oct 03, 2019 5:15 am

Am I running out of memory?

Postby zliudr » Sat Dec 21, 2019 4:06 am

I've grown my code to this point that it works without problems. I added some features today and start seeing wifi erors:

Code: Select all

W (331095) wifi: alloc eb len=32 type=3 fail, heap:1445732

W (331095) wifi: m f auth

I (332095) wifi: state: auth -> init (200)
I (332095) wifi: new:<2,0>, old:<2,1>, ap:<255,255>, sta:<2,1>, prof:1
I (332095) azure: SYSTEM_EVENT_STA_DISCONNECTED
W (332105) wifi: alloc eb len=76 type=2 fail, heap:1436416

W (332105) wifi: m f probe req l=0

W (332235) wifi: alloc eb len=76 type=2 fail, heap:1435136

W (332235) wifi: m f probe req l=0

W (332355) wifi: alloc eb len=76 type=2 fail, heap:1434032

W (332355) wifi: m f probe req l=0

W (332475) wifi: alloc eb len=76 type=2 fail, heap:1432928

W (332475) wifi: m f probe req l=0

W (332595) wifi: alloc eb len=76 type=2 fail, heap:1431824

W (332595) wifi: m f probe req l=0

Is this saying that wifi module fails to allocate memory, i.e. memory is running out?

I am using the latest wrover-b with 8MB of PSRAM and I've enabled " Try to allocate memories of WiFi and LWIP in SPIRAM firstly. " and " Allow .bss segment placed in external memory ". I also used EXT_RAM_ATTR on most of my static arrays.

How do I see available memory?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Am I running out of memory?

Postby WiFive » Sat Dec 21, 2019 7:51 am

Update your idf it was fixed recently

PeterR
Posts: 621
Joined: Mon Jun 04, 2018 2:47 pm

Re: Am I running out of memory?

Postby PeterR » Sat Dec 21, 2019 11:08 am

Hope the IDF fix works.
To answer your question
How do I see available memory?

Code: Select all

struct HeapReport heapReports[] = {
    { MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT,  "data" },       //-- Internal data
    { MALLOC_CAP_EXEC,                      "exe"  },
    { MALLOC_CAP_SPIRAM,                    "spi"  },
    { 0,                                    NULL  }
};

for(int i=0; heapReports[i].name != NULL; i++)
 {    
     heap_caps_get_info(&info, heapReports[i].capability);
     report << "type: " << heapReports[i].name << ", total_free_bytes:" << info.total_free_bytes;
     
& I also believe that IDF CAN should be fixed.

Who is online

Users browsing this forum: Bing [Bot] and 140 guests