(March 2024).
Some applications using pixel displays may run out of memory,
especially if you are running on a small ESP32 with no external
PSRAM. This is especially the case if you are using the small
jaguar
server on the device for fast edit-compile-run
development cycles.
Conversely, if you are running on a device with lots of memory you may improve the performance of the pixel display by using larger buffers.
If you run out of memory you will get stack traces and an
overview of memory usage, to help you debug the situation.
Be sure to run jag monitor
or equivalent so that you can
see the debug output in this case. On a base ESP32 with
the default image, the Bluetooth stack takes up a lot of
RAM. This is the case, even if you are not using Bluetooth.
If this is impacting you, you can use an ESP32 envelope
that does not include Bluetooth support. This is done
for a USB-connected device with
jag flash --chip=esp32-no-bt
or for a Wifi connected device with
jag firmware update --chip=esp32-no-bt
Other envelopes with different C components enabled can be found at https://github.com/toitlang/envelopes/releases
If you have a lot of memory and want to use it to improve display performance, you can update the size of the buffers used to update the pixel display to 10k or even more:
display.max-patch-size = 10_000
How much memory would BT normally use? I'm using an ESP32-C3 with 400kB SRAM, so I'm wondering whether I should avoid it or not. The use case is a GPS tracker that reads location data and sends it over LoRa/BT/Wifi to a base station or other relay stations. So the program itself would not need that much memory, apart from buffering the location data that hasn't been set yet.