在使用espconn_set_opt设置了TCP断开连接后立刻释放内存,好像不生效。我用的是以下的设置方法:
err=espconn_set_opt(conn,ESPCONN_REUSEADDR);
每次TCP被动断开连接后仍然会占用内存2分钟,2分钟后才准时释放。然后下一个TCP才能正常发送,不然一直报内存错误。
而我用以下函数来注册write_finish_callback的时候是有效的,取消设置则无法进入writefinishcallback。所以应该不是函数使用的问题吧?
espconn_set_opt(conn,ESPCONN_COPY);
关于TCP断开连接释放内存的问题
Re: 关于TCP断开连接释放内存的问题
Postby jacklin » Thu May 10, 2018 4:36 pm
Her Majesty wrote:用 system_get_free_heap_size 打印内存看看呢
HI,Her Majesty
经过测试,我发现V2.2.0以下版本存在这个问题,在使用espconn_set_opt() 进行设置以下参数后:
bit 0: 1, TCP 连接断开时,及时释放内存,需等待 2 分钟才释放占内存;
V2.2.0以下版本,非得要2分钟后才释放,相同的程序V2.2.0以下版本经常出现问题。
Who is online
Users browsing this forum: No registered users and 143 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.