Skip to content

memory leak by using WiFiClient (40 Byte per usage) #1070

Closed
@Links2004

Description

@Links2004

test code:

void loop() {
    USE_SERIAL.printf("RAM: %d\n", ESP.getFreeHeap());
    // wait for WiFi connection
    if((WiFi.status() == WL_CONNECTED)) {
        WiFiClient * _tcp = new WiFiClient();
        _tcp->connect("192.168.1.12", 80);
        _tcp->stop();
        _tcp->~WiFiClient(); //does not help but shut abort any connection and free all
    }
    delay(100);
}

return:

RAM: 41312
RAM: 41312
RAM: 41048
RAM: 40816
RAM: 40584
RAM: 40352
RAM: 40104
RAM: 39872
RAM: 39640
RAM: 39408
RAM: 39176
RAM: 38944
RAM: 38712
RAM: 38480
RAM: 38248
RAM: 38016
RAM: 37784

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions