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.

Application free memory Comparison

chip

Empty project

Station

Gatt_server

bleprph

provision(ble & Wi-Fi coexis)

thread

ESP32

366 K

230 K

205 K

201 K

140 K

not support

ESP32-C3

332 K

219 K

215 K

205 K

126 K

not support

ESP32-C3(ECO7)

332 K

230 K

225 K

214 K

136 K

not support

ESP32-C2

197 K

100 K

80 K

98 K

26 K

not support

ESP32-S3

392 K

273 K

276 K

267 K

189 K

not support

ESP32-C6

474 K

321 K

358 K

370 K

259 K

364 K

ESP32-H2

269 K

not support

150 K

166 K

not support

166 K

ESP32-C5

347 K

220 K

225 K

231 K

192 K

231 K

ESP32-P4

608 K

not support

not support

not support

not support

not support

ESP32-C61

265 K

136 K

150 K

159 K

80 K

not support

ESP32-S31

478 K

360 K

364 K

364 K

271 K

366 K

Note

For further optimization of memory usage, please refer to ESP Memory Usage Optimization.

Note

  • ESP32-S31 was tested on master (commit 3a34711eacc41585481ba0e694dacb8d2d84e091), using the default sdkconfig configuration for each example.

  • Other chips have been tested in the release/v5.5 (commit 2e7a9174fcdc18f4c242aba5d9ff90644ea03cd2) version, using the default sdkconfig configuration for each example.

Note

In the ESP32-C3(ECO7), wireless applications have more available RAM, with Wi-Fi related increasing by 10 KB, BLE increasing by 15 KB, and coexistence mode increasing by 20 KB. To use ESP32-C3 (ECO7), please enable the following configurations 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

Available free heap after optimization for ESP32-C3/ESP32-C2

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