Skip to content

Memory usage observation #11

Closed
Closed

Description

@luebbe

Hi Bert,

yesterday I switched my first device (esp8266) from asyncMqttClient to espMqttClient. Looks good! No crashes, no runaway memory, but also no heavy traffic. Just some status reporting and change of settings going back and forth every few seconds.
In the images below you see the heap of the same firmware running running AsyncMqtt (first and espMqtt (second)
Please ignore the peak in the asyncmqtt graph. I made a mistake with my test board and accidentally posted to the same topic as my real hardware. Also the PC went into suspend mode, but the gist remains the same.

AsyncMqtt
AsyncMqtt

EspMqtt
EspMqtt

Summary:

  • espMqttClient uses a bit more memory than asyncMqtt (43K of heap vs 45K of heap), while the rest of the firmware is identical.
  • there is more variation in the free heap. AsyncMqtt stays level at 45K after the initial phase where espMqtt "oscillates" between 42,5K and 43K of free heap all the time

Don't know if these observations play a role, but the most important info is that the free heap doesn't decrease over time :)

So to me it looks really good after 24 hours. 👍

Activity

  1. bertmelis commented on Jun 19, 2022

    @bertmelis
    Owner

    I suspect TCP payload buffering. ESPAsyncTCP forwards the data directly whereas I copy the incoming data to a buffer. On ESP8266 this can be improved with the peek-API but I didn't implement that.

    I didn't benchmark (yet). I've got a few devices that have a 14+ day uptime (with a few MQTT and/or WiFi disconnects).

  2. Repository owner locked and limited conversation to collaborators on Jun 20, 2022
  3. converted this issue into a discussion #13 on Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions