Periodic temporal event only runs once

I have a watchface with a periodic temporal event set up.  The event is fired once but never again after that? 

What could be the cause?

I was thinking may be the background process is running out of memory but I drastically reduced the memory use and still the same result.

Is there any way to check the memory use on just the background process?  What is the limit?

  • How and where are you registering the temporal event?

    Background.registerForTemporalEvent(new Time.Duration(5 * 60));
    with this, it will run every 5 minutes,
    A safe place to do in is in getInitialView().  
    It will only run every 5 minutes in this case, even if you restart the sim - it won't always run right away.
    using 
    System.println(System.getSystemStats().freeMemory) you can see what's free
    In the background code will show you waht's available in the background.  The total varies by device
    Here's the beginning of onTermoralEvents in one of my apps:
        function onTemporalEvent() {
            System.println("total="+System.getSystemStats().totalMemory);
            System.println("used="+System.getSystemStats().usedMemory);
            ...
        }
    and in this case, I see this every 10 minutes when simulating an fr170

    Background: total=61336
    Background: used=7136
  • Thanks.  That is how I am registering the event.  It works on most watchfaces, just not the one I am debugging at the moment.