Thanks for mentioning the possibility to extend RAM on an ESP32.
Found the official documention about it:
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/...
> ESP32 has the ability to also use up to 4 MB of external SPI RAM memory.
> The external memory is incorporated in the memory map and, with certain restrictions, is usable in the same way as internal data RAM.
> While ESP32 is capable of supporting several types of RAM chips, ESP-IDF currently only supports Espressif branded PSRAM chips (ESP-PSRAM32, ESP-PSRAM64, etc).