Using Github Actions to evaluate Flash / RAM size constraints, when using C++ features in ESP-IDF Projects
Feature | D/IRAM | diff to base | Flash | diff to base | Heap alloc | diff to base |
---|---|---|---|---|---|---|
(base C) | 54283 | 0 | 138998 | 0 | 13500 | 0 |
string | 54435 | 152 | 144806 | 5808 | 13596 | 96 |
vector | 54435 | 152 | 143590 | 4592 | 13596 | 96 |
exceptions | 54587 | 304 | 165746 | 26748 | 14752 | 1252 |
iostream | 60627 | 6344 | 354102 | 215104 | 13676 | 176 |
Exception-throwing code should never be used in real-time critical code paths. C++ Exceptions should only be used for exceptional cases, i.e., something happening unexpectedly and occurs rarely.
Simply including <iostream> header in one of the source files significantly increases the binary size by about 200 kB. (Keep C based ESP_LOG module for logging)