-
Notifications
You must be signed in to change notification settings - Fork 238
Heap memory leak caused by client.connect() ? #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Do you know by how much the heap increases on every call? |
I'm loosing between 108 and 836 bytes of heap per call. this may be a problem with the WiFiClient library for ESP32, and not this library. |
Closing, this seems to be a leak in the WiFiClient or WiFiClientSecure libraries within ESP32-Arduino Core. Thank you. |
I am experiencing the same issue with a failed mqtt_client.connect() on the ESP32, losing between 4700~5000 bytes of heap on each call. Was this problem ever tracked down ? |
I traced this to the WifiClient core, it is not an issue in the ardino-mqtt repo. See this thread for a temp fix: espressif/arduino-esp32#3808 (comment) |
I call the following function periodically on an ESP32. The free heap decreases each time I call
connectToMQTT()
, indicating a memory leak.If I comment out the line containing
mqtt_client.connect()
, then the memory leak goes away, and I have perfect heap preservation.I've dug through the library source here and not found any unmatched
malloc()
calls, so I'm stumped as to where the memory is going. Any help would be appreciated!The text was updated successfully, but these errors were encountered: