onUpdate for GLANCE view fires way too often on my real device

As I was trying to figure out the memory consumption for Storage.SetValue, I came around another weird behavior that happens only on my real device this time, not the simulator

I've added a println at the start of the GlanceView onUpdate function that displayed the free memory. The println also prints the current time. The onUpdate is triggered by a Ui.requestUpdate in a timer that fires every FIVE seconds (mTimer.start(method(:onRefreshTimer), 5000, true)). I've also added a println in that onRefreshTimer just before that requestUpdate line (as well as in every function with the :glance label that calls requestUpdate so I would know which one triggers it). This is what the simulator shows and is expected.

Every requestUpdate from the timer is followed by a 'Free memory...' line.

21:41:28 : onRefreshTimer requestUpdate
21:41:28 : Free memory 36 KB
21:41:33 : onRefreshTimer requestUpdate
21:41:33 : Free memory 36 KB
21:41:38 : onRefreshTimer requestUpdate
21:41:38 : Free memory 36 KB
21:41:43 : onRefreshTimer requestUpdate
21:41:43 : Free memory 36 KB

Now compare this to what I see on my device:

21:46:47 : Free memory 37 KB
21:46:48 : Free memory 37 KB
21:46:48 : Free memory 37 KB
21:46:49 : Free memory 37 KB
21:46:50 : Free memory 37 KB
21:46:51 : Free memory 37 KB
21:46:52 : onRefreshTimer requestUpdate
21:46:52 : Free memory 37 KB
21:46:54 : Free memory 37 KB
21:46:54 : Free memory 37 KB
21:46:55 : Free memory 37 KB
21:46:56 : Free memory 37 KB
21:46:56 : Free memory 37 KB
21:46:57 : Free memory 37 KB
21:46:57 : onRefreshTimer requestUpdate
21:46:57 : Free memory 37 KB
21:46:59 : Free memory 37 KB
21:47:00 : Free memory 37 KB
21:47:01 : Free memory 37 KB
21:47:02 : Free memory 37 KB
21:47:02 : onRefreshTimer requestUpdate
21:47:02 : Free memory 37 KB
21:47:04 : Free memory 37 KB

Why is onUpdate being ran so frequently on my device (Fenix 7S Pro)?!?

  • It's funny that in the past few days there were posts about:

    - I'm calling requestUpdate every 50ms, but it's not being called every time, only about once per second (though this was an app, not a widget I think)

    - I'm calling requestUpdate every 5 seconds, but it's being called every second instead

  • Yeah, weird things are becoming the norm lol

    I just check my two apps that do text scrolling in the glance view using a 50 msec timer (however, they don't scroll at 50 msec as it would be too fast! it uses a logic to know how fast to scroll based on screen size). They are still working correctly

    https://imgur.com/a/wDsMl3Q

  • It's also funny that Garmin tells devs to avoid calling requestUpdate more than once per second for CIQ glances, but they seem to do it themselves.

    (For the record I've also played around with faster than once-per-second updates for glances as a proof of concept and it seemed to be fine. Clear some of the native glances update faster than once per second, if only intermittently. I think that any battery life or performance concerns could be allayed by waiting a few seconds to go into "fast update" mode, which is what some native glances seem to do)

  • just a note: As a developer, I probably would also spend time on doing some scrolling, like you did :), but as a user... You either can display all the data I want in 1 glance screen, or maybe 2, and then switch between the 2 every X seconds, or I'd enter the widget and see it on full screen. I wouldn't wait for that LOOOOONG for the text to scroll to where the information I'm interested in will appear.

  • LOL, yeah. It's a setting in the App that you can turn on or off. It's not everyone's "cup of tea".