Reduced runtime memory in Windows 8

Source: Internet
Author: User
ArticleDirectory
    • Memory usage target
    • Memory usage comparison in Task Manager

Memory usage during Windows 8 running is an important factor in determining Windows 8 system requirements and the large number of device types that will host Windows 8. As you know, we want to deliver a complete Windows 8 experience on SOC-Based Low-Power Devices. This makes it possible to retain a large amount of memory for multiple parallel applications.ProgramIt is more important to use and maintain the overall response capability of the device.

It is not particularly obvious that minimizing memory usage on low-power platforms can prolong battery life. What's going on? On any PC, Ram is constantly consuming power. If the operating system uses a large amount of memory, it will force the device manufacturer to add more physical Ram. The more RAM on the motherboard, the more energy it consumes and the shorter the battery life. In some cases, the Additional RAM on the tablet device shortens the battery life of the tablet device by several days, making it impossible for you to sit at the coffee desk and learn about the world outside through the tablet device.

Memory usage target

From the very beginning, we set the goal of Windows 8 to adopt the same system requirements as Windows 7. We know that if we do better, even if the publishing requirements are the same, the application will have more resources to use. Looking back at the "low-end" Hardware in 2009, it will be interesting to find an antique like the 256 MB memory module. We want to ensure that
In the Windows 7 era, hardware users can easily upgrade their existing computers to Windows 8 and take advantage of the features provided by Windows 8. Based on the experience we gained from the legacy computers we intentionally retained in our performance testing infrastructure, we also expect that many computers produced before Windows 7 will be able to run Windows 8.

An important task of Windows 8 is to find opportunities to reduce the memory consumed by existing functions and the memory consumed by the entire motherboard while freeing up space for new functions. Windows 8 has achieved our own goals.

Memory usage comparison in Task Manager

The simplest way to accurately compare the memory usage of Windows 8 and Windows 7 is to install these two operating systems on a 1 gb ram computer at the same time (Minimum Operating System Ram requirements ), then compare them after they have been restarted and idle for a period of time.

The Windows Task Manager provides the main view of the system memory through its "in use" Statistics (see this document for details ). The following figure compares the memory usage of the same computer running Windows 7 and Windows 8 when it is idle. This machine is a netbook used by Steven in his keynote speech at the recent build conference, it has been used for more than three years.

Figure
1-memory usage in Windows 7 SP1

Figure
2-memory usage in Windows 8

Memory usage or even running time of specific hardware and drivers of a computer may be different, therefore, the memory results on different computers will be different (even the memory results on the same computer will be different at different times ). However, we can see that Windows 8 is better in this aspect than Windows 7.

To make operations on the test computer more interesting, go to the Device Manager and disable your display adapter (uninstall the graphics driver ). You can never run a computer like this, but this gives a more accurate estimate of the memory usage of windows. By disabling the graphics driver, the memory usage of the above computer is reduced by 200 MB after a period of time.

Note: For Windows 8, its clean installation also includes the extended Windows Defender technology, which is incorporated into the complete anti-malware function for the first time, according
As described in the "Protect you from malware" blog by Jason, this technology is also optimized for memory and resource usage. (This function does not exist in the clean installation of Windows 7. We recommend that you add security software .)

Free up space in Windows 8

We have made several hundred specific changes to minimize the operating system memory usage in Windows 8. Here I will introduce several specific areas that help greatly save memory.

Memory combination

When evaluating the ram content on a typical running PC, we find that many parts of the memory contain the same content. Redundant data copies between system ram give us the opportunity to reduce memory usage, even the memory usage of service and operating system components.

How can this happen? Applications sometimes allocate memory for future use and initialize all of them to the same value. The application may never use the memory, because the user may never call certain functions. If multiple running applications execute this operation at the same time, redundant memory copies will appear in the system.

Memory combination is a method in which Windows can efficiently evaluate system Ram content during normal activities and find repeated content between all system memories. In Windows, duplicate content is released and only a single copy is retained. If the application tries to write data into memory later, Windows will provide a dedicated copy for it. All of this is done in the memory manager without affecting the application. This method can release dozens to hundreds of MB of memory (depending on the number of applications running at the same time ).

Service change and reduction

Operating system services configured as always-running are an important source of Environment memory usage. When evaluating a series of operating system services during the Windows 8 planning process, we decided to delete a large number of services (13) and change a different set of services to "Manual" to start, at the same time, some "Always running" services are switched to the "Start on demand" mode. In this mode, the "trigger" in the operating system (for example, connecting devices or network addresses are available) will cause the following situations:

    1. Start the service.
    2. The Service performs its operations (any operation may be performed ).
    3. The service is idle for a period of time to ensure that there are no other operations to be performed, and then
    4. The service exits.

You will find that in Windows 8, plug-and-play, Windows Update, and user-mode driver framework services are all triggered, and in Windows 7, these services are always running.

Of course, we have added a lot of new features to Windows 8 (andCode). Some of these new features are packaged as new services. Only two of these new services are automatically started. All other services are manually started or triggered.

Run the same job with less memory

When Windows runs an application and runs its own system for daily management, program files and data are loaded from the disk to the main memory. During the development of Windows 7 and Windows 8 so far, we have analyzed the memory segments (pages) during normal execution and their reference frequencies. It is recommended that you use it frequently if you want to pay for the allocated memory segment. If you do not frequently reference the memory but still need it, you should integrate it with other content.

Shortly after we launched Windows 7, we applied a similar method to multiple low-level Windows Components that traced back to the early 1990s s of NT ). The work includes rebuilding the code architecture and changing the data structure to completely separate the "hot" part (frequently referenced) of the memory from the "cold" part. By tightly integrating hot projects, we reduce the overall runtime memory overhead.

Considering possible changes at any time (Low-Level Operating Systems), we hope to complete the work planned as soon as possible so that we can have enough time to respond to changes. Up to now, these changes have been reflected in Windows 8. This is the result of thousands of Microsoft employees using this product to complete their daily work over the past two years. We have seen consistent results that memory usage on normal computers can be reduced by dozens of MB.

Slow desktop system initialization

Steven and Julie introduced the Metro-style user interface for the first time in March. We expect many tablet users to spend a lot of time in this environment, typically using Metro-style applications. During that demonstration, we also demonstrated that for Windows 8, you can also introduce your existing applications and use them in a very familiar desktop environment.

From the memory perspective, we take advantage of the fact that there will be a group of devices, users spend almost all their time using these devices on the immersive Metro-style user interface. In this case, Windows 8 only initializes the operating system components unique to the desktop environment when necessary. This is another reason for memory savings, which can be saved by about 23 MB immediately. (Note that the Task Manager runs on the desktop, so the Memory number shown above includes the task manager overhead .)

More precise memory priority

Windows 8 has a better solution in determining the priority of memory allocation for applications and system components. This means that Windows can more intelligently determine which memory should be retained and which memory should be removed immediately.

For example, the anti-virus program (AV) Checks files when other programs open files. The memory allocated by the AV program to check the virus signature is usually allocated at one time (it is unlikely that the specific memory will be required again ). In Windows 7, the memory is considered to have the same priority as other memory in the system (for example, the memory allocated by the running instance of Microsoft Excel. If memory becomes scarce, Windows 7 may eventually remove the memory that helps other running applications (such as Excel) Respond to users. In this case, this approach is not the best choice for maintaining system response capabilities.

In Windows 8, any program can allocate memory to "low priority ". This is an important signal sent to windows, that is, when there is a memory pressure, Windows can remove this low-priority memory to free up space, without affecting other memory required to maintain the system response capability.

in general, I introduced our ideas and methods for reducing memory usage in Windows 8. You have seen some sample results. I just briefly discussed some of the engineering design work we have done so far. One thing I didn't discuss at all was the Windows 8 application model, and the process lifecycle changes made to make the new Windows 8 Application "use memory in a more friendly way. Check this information in
// build/content and in future blog posts, as it is a very important part of the disruptive windows transformation process.

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.