Heap Size

User avatar
vishnu046
Posts: 8
Joined: Sat Nov 15, 2014 1:47 pm

Heap Size

Postby vishnu046 » Sat Jan 02, 2016 2:04 pm

Hi,

I am developing application on ESP8266. i am getting this error "No heap available, failed to malloc 1592".

I would like to know that after TCP Sent is memory allocated free or not..?
Vishnu

SaeedKazemi
Posts: 2
Joined: Mon Dec 14, 2015 2:07 pm

Re: Heap Size

Postby SaeedKazemi » Sun Jan 03, 2016 7:01 pm

AFAIK the memory is freed after tcp sent.
However you may monitor the free memory using system_get_free_heap_size()

User avatar
vishnu046
Posts: 8
Joined: Sat Nov 15, 2014 1:47 pm

Re: Heap Size

Postby vishnu046 » Mon Jan 04, 2016 2:14 pm

Hi i am reading the HEAP size ....

Basically i am running a web server... after each POST operation HEAP size is reducing .... at some point it is getting too low and
application not working...
how we can maintain the HEAP memory...

I am attaching the log please check it....
Attachments
Heap Size.png
Vishnu

SaeedKazemi
Posts: 2
Joined: Mon Dec 14, 2015 2:07 pm

Re: Heap Size

Postby SaeedKazemi » Mon Jan 04, 2016 9:20 pm

Some checkpoints that may help you:
1. Check if during handling POST request there is explicit memory allocation(os_malloc, os_zalloc) in your web server code and make sure you free them respectively (before return, break ...)
2. Check for probable out of bound memory access (causes subsequent SKD memory management inconsistent)
especially check temp size (it's large as packet length)
3. Check for use of global variables (receive callbacks can be called concurrently and may cause race conditions)
4. Read notes and warning about using SDK APIs available in the documentation.
5. Finally use more verbose debugging info in you code so that you can localize and isolate the code section that causes memory leak.

Who is online

Users browsing this forum: No registered users and 17 guests