Memory Usage Comparison
This document is used to summarize the memory consumption when running common examples on different chips.
Comparison of Remaining Memory Size for Common Examples
Please note that the following test results have not undergone any memory optimization, they are simply the results obtained after directly running the basic examples in ESP-IDF. If you want to see the results after memory optimization, you can refer to next part, Example: Comparison of remaining memory size before and after memory optimization for ESP32-C3.
example |
ESP32 |
ESP32-C3 |
ESP32-C3(ECO7) |
ESP32-C2 |
ESP32-S3 |
ESP32-C6 |
ESP32-H2 |
---|---|---|---|---|---|---|---|
Empty project |
305 K |
330 K |
330 K |
196 K |
389 K |
465 K |
264 K |
Station |
229 K |
222 K |
230 K |
104 K |
282 K |
327 K |
not support |
Gatt_server |
205 K |
218 K |
230 K |
81 K |
280 K |
365 K |
152 K |
bleprph |
209 K |
219 K |
233 K |
100 K |
281 K |
379 K |
170 K |
provision(ble & Wi-Fi coexis) |
164 K |
134 K |
152 K |
22 K |
193 K |
262 K |
not support |
Note
This data was tested in IDF v5.3.1, using the default sdkconfig for each example.
Note
In ESP32-C3 (ECO7), there is more available RAM for wireless applications: 10 KB for Wi-Fi related, 15 KB for BLE, and 20 KB for Wi-Fi & BLE coexistence. If you want to use ESP32-C3 (ECO7), please enable the following settings in menuconfig:
Component config > Hardware Settings > Chip revision > Minimum Supported ESP32-C3 Revision > Rev 1.1
Component config > SPI Flash driver > Use esp_flash implementation in ROM
Example: Comparison of remaining memory size before and after memory optimization for ESP32-C3
example |
Before memory optimization |
After memory optimization |
---|---|---|
Physical memory |
400 K |
400 K |
Station |
230 K |
304 K |
Station + 1TLS(MQTTS) |
210 K |
300 K |
bleprph_wifi_coex |
178 K |
248 K |
Note
ESP32-C3 data tested in ESP-IDF v5.2.2
Print the station’s free heap memory after the got ip event
Station + 1TLS(MQTTS) data is based on the ESP-IDF mqtt/ssl example, print the free heap memory after the MQTT_EVENT_DATA event
In the ESP-IDF bleprph_wifi_coex example test, nimble BLE broadcast starts after the got ip event, then print the free heap memory