0

Based on this link I added the events to handle memory during background execution. MemoryManager.AppMemoryUsageLimitChanging event fires on app launch. But while moving the app to background and bringing to foreground again, the event doesn't seem to fire. However, OnSuspending is firing for me.

I tried out the sample here which fires the events correctly. But I could not find out any difference from this app to mine. Is there anything extra I should do to get these events correctly?

Also, one point I noticed is that, if I comment out the MainPage UI in the sample above, the events fail to fire there too!

Bells
  • 1,465
  • 1
  • 19
  • 30

1 Answers1

0

Could be due to this known issue on MSDN for Xbox One UWP Apps:

Memory limits for background apps are partially enforced

The maximum memory footprint for apps running in the background is 128 megabytes. In the current version of UWP on Xbox One, your app will be suspended if it is above this limit when it is moved to the background. This limit is not currently enforced if your app exceeds the limit while it is already running in the background—this means that if your app exceeds 128 MB while running in the background, it will still be able to allocate memory.

There is currently no workaround for this issue. Apps should govern their memory usage accordingly and continue to stay under the 128 MB limit while running in the background.

RoguePlanetoid
  • 4,516
  • 7
  • 47
  • 64
  • But still I guess this event - MemoryManager.AppMemoryUsageLimitChanging should fire when app moves to the background :( – Bells Aug 31 '16 at 05:11
  • Indeed, the events should fire unless it's another issue - I've not looked into Xbox One deployment yet but hopefully someone who has might help if they see this and have had same problem? – RoguePlanetoid Aug 31 '16 at 07:54