I'm having some trouble to support widgets for new devices due to the memory limit of the new "glance" feature. And this is not because I want to provide a very fancy Glance view. Actually I would be fine with the "default" view.
I have a few very "heavy", "complex" widgets. By that I mean a lot of lines of code. When I check the memory in the simulator, their "Code" account for more than 30kB. Yes, that's maybe crazy, but, for now, let's assume this amount of code is really needed, optimised and impossible to refactor.
After some tests and research, I realised that the portion of memory taken by "Code" and "Data" is the same in Glance view as in the full widget run. The "(:glance)" annotation doesn't seem to affect it. So I'm kind of stuck. And I personally find it a bit absurd: the Fenix 3 is able to run widgets that the Fenix 6 can't...
My questions:
- Am I correct in my analysis? Am I overlooking some obvious solution? Is there something "easy" I can do (i.e. besides refactoring)?
- (@Garmin) Is it really the intention? Shouldn't only the annotated code (and the "application entry") be taken into account in Glance view? I guess it shouldn't be too hard to tell that to the complier...
- (@Garmin) Alternatively, couldn't you provide a "default"/"dummy" Glance view that doesn't use anything from the code? So the widget code would actually only be loaded when the user opens it?