1 / 29

Low memory and hardware constraints

Low memory and hardware constraints. Andrew Whitechapel Program Manager, Windows Phone Division 2-221. Agenda. Why do you care? Choices for optimizing your reach. Windows Phone resource manager. Best practices. Why do you care?.

macon
Download Presentation

Low memory and hardware constraints

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Low memory and hardware constraints Andrew Whitechapel Program Manager, Windows Phone Division 2-221

  2. Agenda • Why do you care? • Choices for optimizing your reach. • Windows Phone resource manager. • Best practices.

  3. Why do you care? • The Windows Phone SDK is a powerful toolset – use it wisely. • Make your app available on the widest range of WP devices possible. • Ensure users have a great experience with your app on all devices, and at all times. • Memory/hardware constraints can make this an interesting challenge. • A desktop OS, and desktop frameworks, on a phone. • We did work to scale to devices; now it’s your turn. • Apps live in an ecosystem on the phone.

  4. Your choices for optimizing your reach • There’s more than one way to slice a lemon. • Breadth targeting. • Selective targeting. • Feature light-up and tuning. • Broad multi-targeting.

  5. Breadth targeting (everything) • Aim for the lowest common denominator. • Eliminate non-universal features/capabilities/memory usage. • Simplest, most robust approach. • Sacrifice some features.

  6. Selective targeting (a subset) • Via OS/platform version. • Single or multiple app versions. • Regional/market targeting. • Via device capabilities ID_CAP* and requirements ID_REQ*. • Sensors. • Memory.

  7. Feature light-up and tuning • Conditionally enable/disable features. • Allow for chassis/platform variation. • IsSupported. • IsXXXSupported. • Reflection: tiles and in-app purchase. • Static versus dynamic. • ID_REQ_MAGNETOMETER versus Compass.IsSupported.

  8. Check for optional features • Fixed (per device) and dynamic (per user selection).

  9. Tile light-up • Reflection is a two-edged sword. • Enhanced tiles: compile for WP7, light-up in WP8. • Rudy Huyn: http://mangopollo.codeplex.com/

  10. Windows Phone resource management • The ResMan mandate: maintain an optimal user experience across all scenarios. • Memory quotas and caps. • CPU quotas and caps. • Sensor resources. • Paging: the pros and cons. • Why do caps vary by app type? • Requesting a higher cap; and the implications.

  11. Memory cap defaults • Caps are not quotas. • Certification 5.25: “An app must not exceed 90 MB of RAM usage, except on devices that have more than 256 MB of memory.” • 95% of apps use <150MB. *Cannot run concurrently with VOIP.

  12. Memory cap breakdown • Juggling behind the scenes. • “Worst case” != “common case”.

  13. Memory cap breakdown

  14. Best practices • See Stefan Wick’s talk: 2-216, Friday 10:30. • Building for scale enforces discipline. • Use memory APIs to check your usage (debug and release). • Check for user-disabled features. • Tailor image resolution to device; use thumbnails. • Launchers instead of full controls. • Disable page transitions. • Use virtualized lists, load on demand. • Test on all your target emulators; focus on the LCD. • Test on real devices. • Use the profiler (Store Test Kit). • Use developer.nokia.com remote device access. • Seek out memory spikes.

  15. Out-of-memory conditions • Native allocation failures. • Managed OutOfMemoryExceptions. • Managed framework low-memory conditions and GC. • Failures outside your control.

  16. Demo: memory metrics

  17. Memory metrics – sample run

  18. Memory metrics APIs

  19. Memory cap options • Foreground app only. • MAX_CAP == red line on your car rev-counter.

  20. Memory cap options

  21. Screen resolution and scaling

  22. Multi-res

  23. Demo: test image scaling

  24. Image scaling

  25. Summary • For maximum success, do work to support the widest range of devices. • Your app belongs to a balanced ecosystem. • Profile your app, query the device, monitor dynamic features and memory.

  26. Resources • App memory limits for Windows Phone 8: http://aka.ms/Tfdyf7 • Developing apps for lower-memory phones: http://aka.ms/To4as5 • The evolution of Windows Phone memory management: http://aka.ms/Jo85ot • Best practice tips for delivering apps with 256 MB: http://aka.ms/Inx8pg • Optimizing apps for lower-cost devices: http://aka.ms/Rwt4ll • App platform compatibility for Windows Phone: http://aka.ms/Y8fxim • Windows Phone 8 Development Internals (book): http://aka.ms/J83ips

  27. Required Slide *delete this box when your slide is finalized Your MS Tag will be inserted here during the final scrub. Evaluate this session • Scan this QR codeto evaluate this session and be automatically entered in a drawing to win a prize!

More Related