ActivityRecording:Problem with createSession for vivoactive but not vivoactive HR

Hello,

I have a problem which appears with the SDK 2.1 before no problem.
My code:
//to start the session recording
function StartRecording() {
Sys.println("Start session recording");
if( ( session == null ) || ( session.isRecording() == false ) ) {
session = Record.createSession({:name=>"Running Frac.", :sport=>Record.SPORT_RUNNING});
session.start();
}
}
The message on eclipse console show that the problem appears at createSession level:
Connect GPS
Start session recording
Failed invoking <symbol>
Out Of Memory Error
in StartRecording (C:\Users\Sylvain\Documents\Programmation\Garmin\IntervalRunning - Vivo V2.2\source\IntervalRunningView.mc:708)
in onKey (C:\Users\Sylvain\Documents\Programmation\Garmin\IntervalRunning - Vivo V2.2\source\IntervalRunningDelegate.mc:106)
in handleEvent (D:\jenkins\workspace\Tech-CIQ-Win-Rel\mbsimulator\submodules\technology\monkeybrains\virtual-machine\api\WatchUi.mb:422)
in handleEvent (D:\jenkins\workspace\Tech-CIQ-Win-Rel\mbsimulator\submodules\technology\monkeybrains\virtual-machine\api\WatchUi.mb:582)
Connection Finished

I use exactly the same code for vivoactive, vivoactive HR and fr920XT. No problem with the simulator for vivoactive HT and fr920XT, but always same situation with vivoactive since the SDK2.1; on my watche also that don't operate also.
Any idea?
Thanks for your help.

Sylvain
  • Looks like your app is too big... (watch-app - as you wouldn't be doing this in a DF).

    The memory management is a bit different between the va,920 and va-hr. When you start recording on a va, an extra 4k is used. This doesn't happen with the 920 or va-hr. BTW, on the fenix 3hr, it takes an extra 7k... Also, the limit for apps on the va is 64k, while on the va-hr, it's 122k.

    Scale back the size of your app so it can run in the sim for the va, and observe what happens with the memory usage on the bottom line of the simulator window. Or just see what the numbers are for the va-hr and see where you'd be at on the va by adding 4-5k to the memory used...

    The 4k thing is actually seen in the devices.xml file that's part of the SDK.

    Here's one line for the vivoactive. Max of 64k, and 4k used for the session.

    <app id="watch-app" memory_limit="65536" fit_session_memory="4096" />



    Since it works on the 920, you're likely fairly close on the va, and you'll just need to look at reducing the size a bit, and that can be in both the code and the data structures you use to store data.
  • Thanks a lot!
    I optimize my code and just by deleting all sys.println message I recover the memory size in the window.