Some ESP32's have 8MB of PSRAM and 16MB of flash "storage". You can theoretically also add external SRAM modules but I've never seen that IRL for the ESP32 family. I've occasionally seen the flash used as slower, persistent RAM.