Skip to content

Memory leak somewhere #15

@jfseaman

Description

@jfseaman

There seems to be a memory leak.

Where? Library or in PSRamFS_Test.ino?

I did not audit PSRamFS_Test completely.
I did change all the ESP_LOGx(...) to Serial.printf and fixed the formatting.
I changed it to run in loop() instead of setup() with a halt at the end. I kept setup code in setup. Not much of that.

I tried a Arduino Nano ESP32 (16M flash, 8M PSRAM) and a Espressif ESP32-S3 De Kit N8R8 (8M flash, 8M PSRAM)

The leak is in both.

The biggest annoyance is that the leak is different for each iteration.

It could be as simple as an unpaired create/close. Like I said, didn't do a complete audit of PSRamFS_Test.ino and didn't create a sketch from scratch with more limited use of the library.

The leak is from 0 to 440 byes. Varies each run, each pass through loop.

23:13:16.615 -> Free PSRAM: 8385672
23:13:16.615 -> Running test setup_tesrdown
23:13:16.615 -> running test format_mounted partition
23:13:16.658 -> Free PSRAM: 8385672
...
23:13:19.077 -> Test complete
23:13:19.077 -> Starting_Free_PSRAM (8385672) != ESP.getFreePsram() (8385456)
...
23:14:21.563 -> Test complete
23:14:21.563 -> Starting_Free_PSRAM (8385672) != ESP.getFreePsram() (8385244)
...
23:15:24.009 -> Test complete
23:15:24.009 -> Starting_Free_PSRAM (8385672) != ESP.getFreePsram() (8385032)
...
23:16:26.494 -> Test complete
23:16:26.494 -> Starting_Free_PSRAM (8385672) != ESP.getFreePsram() (8384820)
...
23:17:28.963 -> Test complete
23:17:28.963 -> Starting_Free_PSRAM (8385672) != ESP.getFreePsram() (8384588)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions