Hi Mark,
Believe it or not, my Runtime Broker is at 379 MB right now -- and I don't have The Time installed on this computer. I have five different computers I test the app on before I submit it to the Store and it's the only one exhibiting the problem right now,
so something I've installed on here is causing it to leak. Unfortunately The Time has taken considerably more of my free time than I anticipated so I haven't taken the time to figure out which app is causing it.
The thing with TileUpdater.GetScheduledTileNotifications is that it only needs to be called when scheduled tiles are going to be removed. I really did write The Time on a whim because I didn't like the other time apps and took a simple brute-force
approach: When one of my background tasks was triggered, I'd call GetScheduledTileNotifications, remove each from the schedule and then re-populate the queue with
n scheduled tile notifications. So in a scenario where triggers were firing as fast as possible (every fifteen minutes), Runtime Broker memory could go up as quickly as 160 MB/hour.
Again, GetScheduledTileNotifications only needs to be called to remove items. The overwhelming majority of apps that schedule tile updates don't need to remove previously scheduled updates so you won't see the leak on most computers.
Once I found the bug I re-wrote The Time to only make the call when it was absolutely necessary: When the user changes the content of the tiles. For example, if they choose to change the date format or exclude the day of the week. Also, I'm scheduling
far fewer tiles now, so even if GetScheduledTileNotifications gets called the impact on memory is nearly insignificant, it's one-time-only and it will eventually get cleaned up when the user logs off or the app is serviced.
I have VS C# VS project that demonstrates the leak as simply as possible. I'd be happy to share it with you if you'd like. Otherwise, if you're going to write a time app you'll want to become intimately familiar with the background task infrastructure.
This whitepaper is a great place to start.
Please let me know if you have any questions.
Thanks,
Jeff