Engineering field note
Fitting a TinyML Pipeline Into an Embedded Memory Budget
Lessons from measuring buffers, model arenas, and task stacks on a constrained camera node.
On a microcontroller, memory problems often appear far away from the allocation that caused them. The useful fix is a budget, not another round of guessing.
Establish the baseline
I recorded free heap at boot, after camera initialisation, after network connection, and immediately before inference. That sequence showed which subsystem moved the baseline and which one introduced short-lived peaks.
Account for the invisible parts
The model file was only part of the cost. The tensor arena, image conversion buffer, camera frame buffers, network task, and task stacks all competed for the same constrained resources.
Reducing the camera frame count and reusing a conversion buffer recovered more memory than shrinking the model. Measurements changed the optimisation target—and produced a more stable device.