I'm starting to use the .add() to extend arrays where the size is naturally dynamic as it collects sensor data over time. Rather than declare a fixed size array to the max size. For example, a User Setting to define a chunk size (every 20 secs, every 90 secs, whatever)... And save the avg power over that period in an array. Over a 24 hour race that could end up with 5000 elements. Just an example. Most activities won't need more than a couple hundred. This approach may allow devices with smaller memory footprints to run the data field.
I could add a memory check to prevent exceeding the memory footprint of a field before adding an element to the array. And remove the oldest elements. I'm not sure there is an efficient way to remove say the oldest "x" elements, other than to copy the array into another one? Is there a better way to approach this, using a different structure?