The Windows Club

Memory Compression in Windows 10

Memory is an important factor in processing different tasks faster. Since it is electronic memory, it is costly and most people cannot afford huge amount of RAM. Also, there is a limit on RAM that the operating systems can support. But the Memory Compression feature in Windows 10 makes sure that you are getting optimal and balanced usage of RAM along with the page file. The new OS comes with memory optimization that incorporates compression of data occupying the electronic memory. The article talks about how older Windows versions managed memory, what is the memory compression feature and how Memory Compression Works in Windows 10.

Memory Management in older Windows versions

In Windows, the whole memory thing is divided into three distinct parts:

  1. Random Access Memory (Electronic Memory)
  2. Pagefile (Extension of RAM on Hard Disk)
  3. Hard Disk and other types of storage systems

In the older versions, it was necessary to allot a good amount of hard disk space to pagefile.sys that acted as an extension of the electronic memory. Memory management in older versions of Windows was simple and straight. Store the currently running applications and related data to electronic memory and send the least used data to pagefile.sys. While the traditional application resided in main memory, the data part was often pushed to pagefile if it is not used for long. If the capacity of pagefile exceeded, the data on pagefile was replaced. In that case, if the application – that was still in the electronic memory – required old data, it was again to be loaded into the RAM from the hard disk or other storage devices – which means it took more time to read or write data.

In other words, applications and most recent data is to reside in RAM, frequently used data by current applications stayed in pagefile.sys and hard disk was accessed when a new set of data had to be read or written. This includes data not present on pagefile – the data that may have been replaced with a new set.

Memory Management in Windows 8 – The App Pagefiles

With Windows 8, the memory management changed a little. There were two types of applications in Windows 8/8.1. The traditional applications still worked as explained above. Part of them stayed in RAM while required data was stored to pagefile when the applications were idle and when the RAM was full.

The modern apps ran only when they were in focus. If you opened app A and app B and are currently working on app A, the app B along with related data would be pushed back to pagefile. That way, app A can have good access to memory and need not reach out to pagefile for every fetch process. When you sent app A to background by focusing on app B, app A and related data would go to pagefile while app B gets exclusive access to RAM.

This method saved on memory and made apps faster. With Windows 10, the compression feature was added to make it even more faster. The following section explains how it works in Windows 10.

Memory Management in Windows 10 – Compression over Pagefile

The memory management is same as that of Windows 8/8.1. The traditional apps are stored in electronic memory and focused apps are also stored in RAM. If RAM becomes congested due to excess data, the app and data things are compressed up to 40% and accommodated in the same electronic memory.

Windows 10 too uses pagefile.sys to store data off the electric memory. If an app is using too much data but at slower intervals, some of its data is pushed to pagefile if electronic memory is short of free space. If the app becomes aggressive, the data is moved back from pagefile to the electronic memory and some other app is pushed to pagefile to make space for current app. Only in rare cases, the hard disk is approached: when a new set of data or app is to be loaded or when the data required by an app is not present on either RAM or pagefile.
Windows 10 too has two categories of apps: modern and traditional. The traditional applications are stored separately in electronic memory while the modern apps each have their own stack. This makes it easier to push modern apps and related data to pagefile when you open too many apps in a way that memory falls short despite compression.

It saves about 50% of pagefile activity (compared to older versions of Windows) when you are using the memory compression feature in Windows 10 because most of the data is already available on the main memory – in a compressed form. When the app or data is required, it is decompressed and used. So there is the need to keep a portion of RAM empty to provide for uncompressed data. Even when using pagefile, the speed is faster in Windows 10 because the entire app and related data is stored as a compressed page which is accessed in sequential order. While part of data is being uncompressed, the other part is sent to main memory for processing. This too saves time and makes computing faster on Windows 10 machines.

For more details, check out this video on Channel 9.