I have copied this from the Bug Reports forum because, as Jim has pointed out, I haven't provided a method to reproduce the error - and that's the whole point of the post.
I'm not asking for the bug to be fixed: from experience that's a very slow process. I'm looking for a work-around, other than forcibly restarting the app every hour.
My long running app crashes and I suspect memory fragmentation or memory leak in the FW.
It ran for 1:45 on my F5 before crashing out of memory:
I'm monitoring the memory usage at the start of each GPS location cycle and it is steady at around 102 kB.
The crash occurred independently of any user input: it was running fine and then, a few minutes later when I next looked at the watch, it had crashed.
I have run the app twice through the simulator using the FIT file generated in the original session, as far as possible performing the same user inputs as on the original session. The memory usage remains around 105kB. The peak memory remains firmly at 117.5kB.
It peaks at the start of the app when it downloads a large data file containing the race courses and rounding marks.
I have had a small number of similar reports of out of memory errors via ERA on a range of devices: Forerunner® 245: 5.00, vívoactive® 3: 7.40, all reporting memory crashes, but all at different code locations.
This behaviour indicates, and I say this with much trepidation after many decades of software development, that the issue is not with my code, but with the underlying firmware, operating system or hardware.
I had a similar problem on this platform a couple of years ago and discovered the fault was with my code: I had a hierarchy of menus and was not Popping them correctly. At the time, the simulator behaved differently and did not show my memory leak. Since then, I am logging memory usage at the start of each GPS callback to capture any such oversights.
I have re-run the track on through my app on my watch using my own sim code, and it failed to crash for the full 2 1/2 hrs of the test data.
Given that it only occurs sporadically and in my live run, only after a long period of running (1h 50 mins), I wonder if it is being caused by memory fragmentation or some other memory leak in the FW?
And if so, what can I do about it?