Memory Leak/Usage
Memory Leak/Usage
Postby zaxl » Thu Jul 23, 2015 4:41 pm
I'm using the memory optimized SDK 1.2.0.
The issue is that my tcp disconnect callback is not called and each accepted tcp connection leaks between 108 and 288 bytes.
/Will figure exact number but this is from a timer that runs every second to report free heap/.
Tried to set option REUSEADDR but does not make any difference.
I'm using code based on the esp_httpd .
init ....
espconn_regist_connectcb(&httpdConn, httpdConnectCb);
espconn_tcp_set_max_con_allow(&httpdConn, MAX_CONN);
espconn_set_opt(&httpdConn, ESPCONN_REUSEADDR);
espconn_accept(&httpdConn);
static void ICACHE_FLASH_ATTR httpdConnectCb(void *arg) {
....
....
espconn_regist_recvcb(conn, httpdRecvCb);
espconn_regist_reconcb(conn, httpdReconCb);
espconn_regist_disconcb(conn, httpdDisconCb);
espconn_regist_sentcb(conn, httpdSentCb);
}
I'm closing the connection from my main loop but httpdDisconCb is not called.
The incoming connection limit is a kind of useless - with 2 minutes timewait i can generate enough connections to trigger an out of memory condition. Connect/Close 200 bytes per connection about 100 connections and the device is OOM.
What is the way to deal with TCP memory in general?
Regards
zaxl
Re: Memory Leak/Usage
Postby ESP_Faye » Mon Aug 03, 2015 10:06 am
So sorry for the inconvenience. Could you provide your test code ? We will have a try.
espconn_regist_reconcb(conn, httpdReconCb);
espconn_regist_disconcb(conn, httpdDisconCb);
If the TCP connection broke unexpected, httpdReconCb will be called.
If espconn_disconnect is called or normally TCP disconnect, it will enter httpdDisconCb.
Re: Memory Leak/Usage
Postby zaxl » Wed Aug 05, 2015 2:01 pm
I'm working on a test case code, i'll give it out when ready.
My code flow is like this:
1. listen on port 80 -> web server
2. outbound ssl connection to server. close connection
3. start normal connection to server - long lived
So far i found out that:
If there is only listen on port 80 -> disconnect callback is called - no leak
If there is outbound connection /don't know which one is causing the problem yet/ -> disconnect callback is not called and it leaks.
zaxl
Re: Memory Leak/Usage
Postby ESP_Faye » Sun Aug 09, 2015 8:52 am
Please have a try with the latest sdk_v1.3.0 http://bbs.espressif.com/viewtopic.php?f=46&t=918&p=3092
If your problem is still unsolved, please provide your test code. We will debug it.
Thanks for your interest in ESP8266!
-
- Posts: 5
- Joined: Sun Aug 09, 2015 4:16 am
Re: Memory Leak/Usage
Postby mharizanov » Mon Aug 10, 2015 2:28 pm
I tried with SDK 1.2 and 1.3 and it fails with both. It works just as expected with SDK 1.1
Re: Memory Leak/Usage
Postby ESP_Faye » Mon Aug 10, 2015 4:33 pm
So sorry for the inconvenience.
Please update to esp_iot_sdk_v1.3.0 and try the SSL patch here http://bbs.espressif.com/viewtopic.php?f=46&t=925
Please have a try. If your problem is still unsolved, feel free to let us know !
Thanks for your interest in Espressif Systems and ESP8266 !
-
- Posts: 5
- Joined: Sun Aug 09, 2015 4:16 am
Re: Memory Leak/Usage
Postby mharizanov » Tue Aug 11, 2015 1:17 am
SSL example
Postby hdrut » Wed Aug 12, 2015 12:33 am
I'm trying to implement the SSL example provided by Espressif, but get the following errors I can't debug:
undefined reference to `espconn_secure_sent'
undefined reference to `espconn_secure_connect'
Any help is appreciated.
Rgds
Re: SSL example
Postby rudi » Wed Aug 12, 2015 3:15 pm
hdrut wrote:Hi,
I'm trying to implement the SSL example provided by Espressif, but get the following errors I can't debug:
undefined reference to `espconn_secure_sent'
undefined reference to `espconn_secure_connect'
Any help is appreciated.
Rgds
think you simple forget "to add" the ssl lib in makefile?
example:
Code: Select all
LIBS = c gcc hal phy pp net80211 lwip wpa upgrade main ssl
write please, how you get on in this.
best wishes
rudi

-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Re: SSL example
Postby hdrut » Wed Aug 12, 2015 8:14 pm
yes! That was the problem, how silly of me

How are you doing? Have you managed to do some progress on copy protection for ESP?
I am now trying SSL communication, just started...
Cheers, i am going to celebrate my birthday today !!
Hope to hear from you soon, wish all is fine with you Rudi,

Horacio
rudi wrote:hdrut wrote:Hi,
I'm trying to implement the SSL example provided by Espressif, but get the following errors I can't debug:
undefined reference to `espconn_secure_sent'
undefined reference to `espconn_secure_connect'
Any help is appreciated.
Rgds
think you simple forget "to add" the ssl lib in makefile?
example:Code: Select all
LIBS = c gcc hal phy pp net80211 lwip wpa upgrade main ssl
write please, how you get on in this.
best wishes
rudi
Who is online
Users browsing this forum: No registered users and 4 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.