Out Of Memory Error due to fragmentation?

Is it possible that the Out Of Memory Error  in my app is caused by fragmentation?

  1. It's crashing intermittently on the watch (F5) with Out of Memory error after around one hour operation.
  2. I am not able to replicate the crash while running in the sim, however the sim often crashes with Out Of Memory in development as the app is loading. The only way to clear the error is to reload the sim.
  3. It's only started since I introduced Fit Contributor.
  4. I think it's occurring as the app performs session.addLap(), but I can't be sure as the stack trace in the error log points way outside my code area (0x30000f9f).
  5. In the sim, I can replay the track and even after two hours the Peak memory never exceeds 115 Kb.
  6. While running, I am monitoring the used memory every second and uploading the results every minute to my server. The result is a flat line at 98 Kb.

If it is fragmentation, how can I anticipate its onset and work around it?