Says it all. If it makes a difference, I'm using arduino-cli to compile the project from within Visual Studio. Building it using the Arduino IDE produces the same results.Code:1>------ Build started: Project: SmartHome, Configuration: Release x64 ------ 1>Memory Usage on Teensy 4.1: 1> FLASH: code:468856, data:78796, headers:8376 free for files:7570436 1> RAM1: variables:88160, code:434672, padding:24080 free for local variables:-22624 1> RAM2: variables:79488 free for malloc/new:444800 1>Error program exceeds memory space
I've pushed as much of my project as I can into FLASHMEM, but it's got to be pulling in a huge amount of library code which is causing the overflow. What options do I have to determine what library code is being pulled in to make the image so large?
A brief experiment showed that the QNEthernet library clocks in at about 100k. That's big, but I can live with it since Ethernet connectivity is vital to this project.
The one thing I'm beginning to suspect is the used of STL templated classes, e.g. std::vector, std::string, std::unordered_map etc. etc. etc. I'm aware of the String class that exists in the Arduino libraries, was that created precisely to avoid the code bloat that can potentially happen with std::string?
Many many many moons ago, one of the first projects I worked on in C++ had a simple rule: no use of standard template classes, and when I asked why, the answer was code bloat. They had been found to expand the output binary so much that it risked not fitting on one of the targets: the Sony PS1. That'll tell you how long ago this was.Could I be facing the same problem here?