TechExploring Windows Memory Management: To compress or not?

Exploring Windows Memory Management: To compress or not?

Windows compresses the contents of RAM to fit more into it and avoid using the swap file, operating under the assumption that disk operations are always slower than processing. This leads to a preference for compression over paging.
How to turn off memory compression?
How to turn off memory compression?
Images source: © Pixabay
Kamil J. Dudek

The effectiveness of having a significant amount of RAM, automatic facilities, and paging becomes questionable in terms of performance when control over the system memory manager is very limited. Windows manages its memory settings in the Registry under "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management," but these primarily adjust automatic adaptations and file sizes.

Limited capabilities

There is scant documentation for the FeatureSettings switch, which might influence the manager's behavior. Some options occasionally emerge to address issues like Meltdown and Spectre, yet options for controlling memory management are few:
- Disabling paging (removing the swap file)
- Disabling preload into memory (prefetch)
- Disabling prelaunch

- Combining memory pages

- Compression of used RAM

Disabling the swap file might not be advisable for several reasons, including compatibility. Similarly, disabling prefetch/preload mechanisms should be approached with caution; though they seem increasingly irrelevant with current computing practices, they can significantly affect the speed of starting applications.Disabling compression

Disabling memory compression appears to be the least invasive option, yet its impact on performance improvement may be negligible or hard to quantify. This differs from Linux systems, which allow for more direct control over the swap file usage through "swappiness." In Windows, alterations can only be made to the swap file's size, location, and presence.

Memory compression status can be checked in the Task Manager's Memory section, which shows the compressed amount - usually a low figure as RAM is inherently diverse and compresses poorly. However, lower disk speeds compared to processors and RAM can justify even modest improvements. To disable memory compression, one should use the MMAgent system collection in PowerShell. The following command stops the memory compression process, preventing further compression of content, and soon the reported amount of compressed memory drops to zero. If performance does not improve or worsens (a significant possibility with systems under 8GB of RAM), compression can be enabled again with the appropriate command.

Should disabling memory compression and the swap file not lead to an overall boost in performance despite ample RAM, it may indicate reaching the performance limit of the current hardware. In such cases, more advanced profiling is necessary, bearing in mind that a single number rarely describes a computer's overall performance adequately.
© Daily Wrap
·

Downloading, reproduction, storage, or any other use of content available on this website—regardless of its nature and form of expression (in particular, but not limited to verbal, verbal-musical, musical, audiovisual, audio, textual, graphic, and the data and information contained therein, databases and the data contained therein) and its form (e.g., literary, journalistic, scientific, cartographic, computer programs, visual arts, photographic)—requires prior and explicit consent from Wirtualna Polska Media Spółka Akcyjna, headquartered in Warsaw, the owner of this website, regardless of the method of exploration and the technique used (manual or automated, including the use of machine learning or artificial intelligence programs). The above restriction does not apply solely to facilitate their search by internet search engines and uses within contractual relations or permitted use as specified by applicable law.Detailed information regarding this notice can be found  here.