  94% of apps peak at 92% of apps average at 512MB Phone 1GB Tablet 2GB Desktop Total physical Paging level BSP, OS, drivers, services OEM/MO service agents VOIP or Background audio VPN Component usage (ballpark) Foreground.

Download Report

Transcript   94% of apps peak at 92% of apps average at 512MB Phone 1GB Tablet 2GB Desktop Total physical Paging level BSP, OS, drivers, services OEM/MO service agents VOIP or Background audio VPN Component usage (ballpark) Foreground.



94% of apps peak
at <150MB.
92% of apps
average at
<100MB.
512MB
Phone
1GB
Tablet
2GB
Desktop
Total physical
512
1024
2048
Paging level
200
200
1600
712
1224
3648
BSP, OS, drivers, services
425
425
425
OEM/MO service agents
22
40
VOIP or Background audio
66
80
80
VPN
10
10
20
523
555
525
185
390
900
4
279
2223
Component usage (ballpark)
Foreground App
Back-stack, Task completion, BG tasks, More FG apps
Example:
512MB device
Task type
Memory
Cap MB Lifetime
CPU
Block in
Batt-Sav
Default Background Task
16
30 sec
10%
Y
Long-Running Bluetooth
16
∞
10%
Y
Extended Execution
150
10 min
10%
Y
Background Audio Playback
25
∞
10%
N
VOIP Active Call
66
∞
70%
N
Modern Foreground App
185
∞
70%
N
Task type
Priority
Foreground App
2
VOIP
2
Background Audio
2
VPN
2
Background Transfer
Bluetooth
CachedFileUpdater/ShareDataPackage Task
2 or 6*
3
3 or 6*
Task Completion
4
Geofence-triggered Task
5
Default Background Tasks
6
App in the backstack
7
Sensor resources
Example:
Background
Audio Agent
Resource
Microphone
Camera
Proximity
Gyro
Compass
Accelerometer
Vibrator
Push
SpeechSynthesis
SpeechRecognition
Audio
InterruptiveUI
Allowed?












NetworkInformation.NetworkStatusChanged += OnNetworkStatusChanged;
Battery.AggregateBattery.ReportUpdated += OnBatteryReportUpdated; ;
bool isGyro = Gyrometer.GetDefault() != null;
bool isAccelero = Accelerometer.GetDefault() != null;
bool isCompass = Compass.GetDefault() != null;
MediaCapture mediaCapture = new MediaCapture();
bool isCamera = mediaCapture != null;
BatteryReport batteryReport = Battery.AggregateBattery.GetReport();
if (batteryReport.Status != BatteryStatus.NotPresent)
{
int charge = (int)batteryReport.RemainingCapacityInMilliwattHours;
}
ConnectionProfile profile =
NetworkInformation.GetInternetConnectionProfile();
ConnectionCost cost = profile.GetConnectionCost();
if (cost.Roaming || cost.OverDataLimit)
; // prompt for user opt-in.
else if (cost.ApproachingDataLimit)
; // throttle behavior.
MemoryManager.AppMemoryUsageIncreased += OnAppMemoryUsageIncreased;
MemoryManager.AppMemoryUsageDecreased += OnAppMemoryUsageDecreased;
ulong usageLimit = MemoryManager.AppMemoryUsageLimit;
ulong usage = MemoryManager.AppMemoryUsage;
ulong headroom = usageLimit - usage;
AppMemoryReport appReport = MemoryManager.GetAppMemoryReport();
ulong privateCommit = appReport.PrivateCommitUsage;
ulong peakPrivate = appReport.PeakPrivateCommitUsage;
ulong totalCommit = appReport.TotalCommitUsage;
ulong commitLimit = appReport.TotalCommitLimit;
ProcessMemoryReport processReport =
MemoryManager.GetProcessMemoryReport();
ulong privateSet = processReport.PrivateWorkingSetUsage;
ulong totalSet = processReport.TotalWorkingSetUsage;
BackgroundEnergyManager.RecentEnergyUsageIncreased +=
OnRecentEnergyUsageIncreased;
BackgroundEnergyManager.RecentEnergyUsageReturnedToLow +=
OnRecentEnergyUsageReturnedToLow;
uint usage = BackgroundEnergyManager.RecentEnergyUsage;
uint usageLevel = BackgroundEnergyManager.RecentEnergyUsageLevel;
if (usageLevel == BackgroundEnergyManager.NearTerminationUsageLevel)
;// Get ready to be terminated.
else if (usageLevel == BackgroundEnergyManager.ExcessiveUsageLevel)
;// Throttle back urgently.
else if (usageLevel ==
BackgroundEnergyManager.MaxAcceptableUsageLevel)
;// On the wall of shame.
else if (usageLevel ==
BackgroundEnergyManager.NearMaxAcceptableUsageLevel)
;// Approaching the wall of shame.
else if (usageLevel == BackgroundEnergyManager.LowUsageLevel)
;// Good citizen.