I have a DataField that shows many different things and does some calculations as well. I have been jumping through hoops keeping the memory down, and I am right now targetting it for my watch (FR630) with has a memory budget of 28.6kB per DataField (as reported in the simulator). The simulator reports a usage of 26.2kb at the bottom of the screen and 27.3kB as Peak Memory in the Active Memory window. It does not fail. When I load it onto my watch (sideload or as beta from the store, doesn't seem to make a difference) it fails and the CIQ_LOG.YML file reports out of memory error.
The errors seem to be related to the DataField "re-drawing" itself, as they typically happen when I switch to a different screen or when I hit the Lap button and the Lap Summary screen appears.
Any suggestions of how to do any (or all!) of the following:
- get the simulator to force a redraw event so I can see the same behavior.
- in general, get the simulator to match the behavior of the watch. It is very time consuming to sideload the app repeatedly for debugging.
- reduce memory. In particular, are there any "best practices" for minimizing the layout and graphics (I create a "drawable" that is composed of a bunch of rectangles to create separator lines. I could not find a different way to draw a simple line...). I saw that there was a way to draw directly onto the screen (without using layouts and drawables, but it seemed much more complicated. Is it more memory efficient and therefor worthwhile to figure it out?
- I already minimized my class variables by doing most of my calculations in the onUpdate() call. Are there some other tricks to minimize memory usage?
Thanks for any help and suggestions!
Gerald