Complete

Simulator not changing setting, but keeps new settings as tmp file in TEMP folder

I am facing following behavior in the sim, any idea what can be causing this please ?

1.) Watchface starts OK in sim-> set files is created using default values from properties (Memory reports 74kB Memory peak and 380 objects peaks)
2.) Modifying settings using Connect IQ - App Settings editor in Eclipse
3.) Clicking Send Settings
4.) After some time new settings processing finishes, NO changes are reflected on watchface (Simulator reports Peak Memory 82.6kB and 569 peak objects)

In the file system TEMP directory where sim is pointed i can see new file  "temp_appsettings<multiple_random_digits>.tmp" has been created on same level as GARMIN folder, but set file has not been replaced with new data.
In rare occurrence new set file is created but has 0bytes size. Working SET file has 3.98kB

  • Update: i did not find reason why suddenly simulator and device reports 27kB less memory peak with same code, given it is on levels i expect i am ok guessing something was wrong in my environment. However i still have problem with background when on the first run available memory is significantly higher while very low on the second one. My understanding is once background task finishes its memory is freed. Jim or Garmin guys would you have some hint where to look at please ? This is Free memory details i am getting while running background.
    Background: 11:48 Entering onTemporalEvent
    Background: FreeMem Process Entry: 20504
    Background: Start: 2020-06-16T09:48:14Z
    Background: End: 2020-06-16T09:48:14Z
    Background: 200
    Background: FreeMem Before exit: 14496
    
    Background: 11:53 Entering onTemporalEvent
    Background: FreeMem Process Entry: 9448
    Background: Start: 2020-06-16T09:53:14Z
    Background: End: 2020-06-16T09:53:14Z
    Background: 200
    Background: FreeMem Before exit: 3440
    
    Background: 11:58 Entering onTemporalEvent
    Background: FreeMem Process Entry: 20504
    Background: Start: 2020-06-16T09:58:14Z
    Background: End: 2020-06-16T09:58:14Z
    Background: 200
    Background: FreeMem Before exit: 14496
    
    Background: 12:03 Entering onTemporalEvent
    Background: FreeMem Process Entry: 9448
    Background: Start: 2020-06-16T10:03:14Z
    Background: End: 2020-06-16T10:03:14Z
    Background: 200
    Background: FreeMem Before exit: 3440
    1. run - as expected 2. run - not expected, in fact entry available memory is lower than last exit one 3. run - as expected 4. run - not expected ..and it keeps alternate Each second run background available memory is so significantly lower i assume thats the place where things are getting messed up when loading same amount of json data as during run 1. (this test run was executed with smaller then expected json data sample )
  • Still digging into it and things are getting weirder, i still think problem is on my side but not that much convinced anymore: Steps taken: - new PC, fresh Windows 10 build 19041, fresh Eclipse install, CIQ 3.1.8 - new project, not single character copy paste from backup, line by line manually written - running tests when each complete block of code/function is finished, similar to what  Jim suggested just totally from the scratch Results: - Settings remain stable in sim and on real watch as well - With the same code (text compare show differences only in spaces and empty lines i made to have code better readable) Simulator now reports 27kB ! less during memory peak in settings change, i am absolutely happy because it finally corresponds to my calculations with amount and types of properties. But how is that possible ? - Background suddenly reports 7kB  less memory (before 17kB now 10kB)  with initialize and onTemporaryEvent function with minimum code as reported above and  no changes in App.Base code with (:background), compared to the problematic code version. Its like something has been loaded into the background instead, cannot figure what.
  • So your changes resulted in this. I see two ways to narrow it down. 1) start with what you have now and back out the changes one at a time until this doesn't happen. 2) start with what you had before and put in the changes one at a time until this occurs. Whatever is happening is far from typical/normal, as many apps do what you are trying to do.  I'd probably do #2 myself.
  • Correct, i changed/merged bunch of properties from boolean to list to save memory.
  • But this wasn't happening before you refactored your code and removed a bunch of properties, correct? I have a number of apps with a background service and have never seen anything like this