Evolution of Windows Phone memory management [E800]

Source: Internet
Author: User

[E800 compilation]In this article, I will elaborate from a macro perspective, so that you can understand the reasons behind the use of guidance, andWindows PhoneMemory ManagementMethod evolution ensures that the application can be used normally. See the following table:

Version

Device

Minimum capacity

Maximum capacity

Paging

Wp OS 7.1

All

90 M

Variable

None

Wp sdk 7.1.1 update

256 MB

90 M

110 M

Starting from 55 MB

Wp sdk 7.1.1 update

Greater than or equal to 512 MB

90 M

Variable

None

History

Wp OS 7.0 and 7.1, the application is limited to 90 m memory. However, the available capacity may exceed 90 MB. 90 m is the minimum value. As for the maximum value, some Programmers think that there is no memory limit for WP applications and the available memory is greater than 90 MB. In fact, applications are often challenged-because the extreme values are not constant. The memory that an application can consume can remain above 90 MB, and to some extent, the allocation may fail. For a hosted application, an OutOfMemoryException (OOM) is implemented on the surface.

The application that triggers OutOfMemoryException and processes it will end. To be exact, when the application reaches the top of the variable value depends on the running status inside the system. The Resource Manager Component in the mobile phone manages the application memory, but does not manage the OS itself. Therefore, the amount of memory available for use changes: Generally, the minimum is 90 MB, sometimes more, sometimes not. This kind of predictability is hard to cope. The data on the existing WP Store directory shows that most applications will not be within 90 MB. This means that some applications will exceed 90 MB.

After WP7.1.1 is released, the application memory peak value will be more interesting. 90 m is the only guarantee. The paging of WP7.1.1 is also very interesting. Currently, the OS can be paged, but it is not in the mobile phone. Because paging is time-consuming and affects UX, it may also reduce the effect of flash memory.

Paging is common in desktop and server computers, but not in mobile devices. Paging allows the system to allocate more memory. It is implemented by using a flash page file. On WP 7.1.1, applications can be allocated to MB of virtual memory. If the application only uses 50 to 60 MB of memory, the memory used is physical memory. If the application memory consumption exceeds the allocated value, you can obtain additional virtual memory in the page file. During application execution, code and data outside the page file will be paged or removed as needed.

It takes a lot of time to move the page into and out, and writing the page will cause the flash device to wear out. Excessive page write results in Flash loss. The overall performance of the device is degraded, and the OOM of the application will increase. 7.1.1 one challenge is to point out the best paging value, so that we will not see Flash performance degradation in the device's expected lifecycle.

7.1.1 pagination is introduced to meet the needs of low-memory devices. Global demand for mobile phones that meet the minimum usage needs and have low memory available. You can perform a simple calculation even if you do not have detailed information:

Total physical memory

 

256

Modem

30

 

Image

40

 

OS

50

 

Device Driver, system scope, page pool, system cache, etc.

40

 

Background audio, various Buffering

40

 

Total

200

 

Remaining memory

 

56

In the wp OS 7.1 memory mode, if all programmers stick to the guidance of up to 90 MB

If no page is displayed, most existing applications run on a m device with excessive OOM values. Note that this is based on application charts, most of which are suitable for 55 MB of physical memory and 90 MB for more than 90% of the applications. In addition, even if the application consumes 90 MB, it will not stay in this status. This means that most applications do not have pagination. The paging value allows us to retain support for the existing WP Store directory, while still generating predictable, balanced overall UX.

7.1.1 The paging mode allows the application memory usage to reach 110 MB, but the available usage is fixed. On a m device, OOM is usually displayed when the value exceeds m. The same applications running on high-memory devices may exceed 110 MB, although this is not guaranteed now.

From a large perspective, this means that a large number of applications in the existing directory can be used smoothly on all known devices. Most importantly, applications use better performance on devices with a memory larger than 110 MB, because applications may have more available memory in most cases, not limited to MB.

Programmer's choice

Now, you know the reasonable amount of memory management for WP OS7.x. What can you do? There are two options:

The first option is to adapt the application to 90 M so that it can be used on all devices. There are many technologies that support platform APIs for you to adjust your applications. Of course, you can use the Visual Studio cache analyzer to monitor the performance of an application during running. If you are not suitable for 90 M but 110 M, you can use it on all devices. However, your UX may not run well on a m device due to paging. The API provides you with enough tools to adjust your application. You may be able to enable the subset function on a device with high memory.

If you still cannot adapt to 110 M after tuning and conditional disabling of certain performance, you can also choose another option. First, edit the application to find the code path that causes memory consumption to exceed MB. If this problem occurs only occasionally, it is still acceptable. If this happens frequently, downgrade from a low-memory device to an application. Remember: low memory devices are especially important. If you cannot use applications for low-memory devices, you need to clear them out of the smartphone application market.

About the future

Pagination is used to support the maximum usage on the device. The cost is a slight reduction in performance. However, even so, the user is still imperceptible.

So what is the subsequent policy? In WP 8, OS is no longer Windows CE, and is replaced by common code libraries sharing Windows 8. Of course, pagination is used in Window 8. Does this mean we will use pagination in WP 8? This policy has not changed since 7x: the OS can be paged, and we are willing to use paging. The purpose is to support applications on all devices without unexpected side effects on UX.

For example, you can see the latest WP8 mobile phones from Nokia and HTC, including 720 p (1280*720) or WXGA (1280*768) ads. If you think about it, you will find that a higher resolution consumes more memory. 7x only supports WVGA (800*480). If you upgrade the 7x system to obtain images of higher resolution, the existing images can also be expanded. The existing 7x applications will occupy more memory on WP8. At this moment, although we cannot predict the running details of applications on WP8, we don't have to worry too much because we have been thinking too much about 7x to WP 8 for some time.

Original article:Http://blogs.windows.com/windows_phone/ B /wpdev/archive/2012/10/08/the-evolution-of-windows-phone-memory-management.aspx

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.