khoih-prog / AsyncHTTPSRequest_Generic

Simple Async HTTPS Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of AsyncTCP_SSL library for ESP32 (including ESP32_S2, ESP32_S3 and ESP32_C3), WT32_ETH01 (ESP32 + LAN8720). Supporting in the future for RP2040W, ESP8266, Portenta_H7, STM32 with built-in LAN8742A Ethernet, etc. Now you can send HTTP / HTTPS requests to multiple addresses and receive responses from them
GNU General Public License v3.0
19 stars 4 forks source link

Update for memleak in AsyncHTTPSRequest_Impl_Generic.h #13

Closed roelandkluit closed 2 years ago

roelandkluit commented 2 years ago

Proposed fix for memory leak

khoih-prog commented 2 years ago

Hi @roel80

Thanks for the terrific fix, which is one of the reasons causing crashes / memory-leak. I also spot another bug causing crash at the beginning or using full _ASYNC_HTTPS_LOGLEVEL_ == 4

I'll spend some more time to test, fix and clean up the code, before merging and publish a new better version.

Best Regards,

khoih-prog commented 2 years ago

Hi @roel80

The AsyncHTTPSRequest_Generic v2.2.0 has just been released. Your contribution is noted in Contributions and Thanks.

Please help with more rigorous tests to see if there is any more memory-related issues. As you know, there is so much a guy can do, especially with too many libraries to develop and take care, without the help of many more people.

Still waiting for more bug reports and fixes from you ;=}}

The library is better and better thanks to contribution users like you.

Best Regards,


Releases v2.2.0

  1. Fix crash when turn-on debug or start
  2. Fix memory leak. Check Having problemen with AsyncHTTPS memory leak #11 and Update for memleak in AsyncHTTPSRequest_Impl_Generic.h #13
khoih-prog commented 2 years ago

The latest test is so good. No crash and stable heap. Thanks for everybody involved, @roel80. @nilber

Starting AsyncHTTPSRequest_ESP_HeapTest using ESP32_DEV
AsyncTCP_SSL v1.3.1
AsyncHTTPSRequest_Generic v2.2.0
Connecting to WiFi SSID: HueNet1
...
AsyncHTTPSRequest @ IP : 192.168.2.86
Current HeapFree: 256924 increase: 88380
Current HeapFree: 189244 decrease: 67680
Current HeapFree: 189060 decrease: 184
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189032 decrease: 28
Current HeapFree: 189064 increase: 32
Current HeapFree: 189060 decrease: 4
Current HeapFree: 189060 increase: 0
Current HeapFree: 189068 increase: 8
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189068 increase: 8
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189068 increase: 8
Current HeapFree: 189068 increase: 0
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189068 increase: 8
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189056 decrease: 4
Current HeapFree: 189060 increase: 4
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189024 decrease: 36
Current HeapFree: 189072 increase: 48
Current HeapFree: 189060 decrease: 12
Current HeapFree: 189068 increase: 8
Current HeapFree: 189064 decrease: 4
Current HeapFree: 189060 decrease: 4
Current HeapFree: 189068 increase: 8
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189068 increase: 8
Current HeapFree: 189068 increase: 0
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189056 decrease: 4
Current HeapFree: 189060 increase: 4
Current HeapFree: 189068 increase: 8
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189052 decrease: 8
Current HeapFree: 189060 increase: 8
Current HeapFree: 189068 increase: 8
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189060 increase: 0
Current HeapFree: 189068 increase: 8
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189068 increase: 8
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189060 increase: 0
Current HeapFree: 189056 decrease: 4
Current HeapFree: 189060 increase: 4
Current HeapFree: 189068 increase: 8
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189068 increase: 8
Current HeapFree: 189056 decrease: 12
Current HeapFree: 189060 increase: 4
Current HeapFree: 189068 increase: 8
Current HeapFree: 189052 decrease: 16
Current HeapFree: 189060 increase: 8
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189068 increase: 8
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189052 decrease: 8
Current HeapFree: 189068 increase: 16
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189056 decrease: 4
Current HeapFree: 189060 increase: 4
Current HeapFree: 189060 increase: 0
Current HeapFree: 189068 increase: 8
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189056 decrease: 4
Current HeapFree: 189060 increase: 4
Current HeapFree: 189068 increase: 8
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189068 increase: 8
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189068 increase: 8
Current HeapFree: 189068 increase: 0
Current HeapFree: 189068 increase: 0
Current HeapFree: 189060 decrease: 8
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189060 increase: 0
Current HeapFree: 189052 decrease: 8
Current HeapFree: 189060 increase: 8
Current HeapFree: 189060 increase: 0
Current HeapFree: 189056 decrease: 4
Current HeapFree: 189056 increase: 0
Current HeapFree: 189056 increase: 0
Current HeapFree: 189060 increase: 4
Current HeapFree: 189044 decrease: 16