Windows 11’s Memory Compression helps the system use RAM more efficiently. When RAM starts to fill up, Windows writes inactive data to the slower pagefile on disk. However, Memory Compression compresses some memory contents so more data can stay in RAM rather than be offloaded to disk. This process improves responsiveness and speeds up performance.
While there are things you need to consider before turning on or off Memory Compression, it’s a generally helpful feature to know about. This guide will walk you through enabling or disabling Memory Compression in Windows 11.
How to enable or disable Windows 11’s Memory Compression with PowerShell
Before turning Memory Compression on or off, note that you’ll need administrative privileges. To enable or disable Memory Compression with PowerShell, follow the steps below:
Step 1: Check if Memory Compression is enabled or disabled
Check if Memory Compression is enabled or disabled using PowerShell. Knowing the status should help determine if you need to proceed to the next steps. Do so by following the steps below:
- Press Win + X, click on Terminal (Admin), and select Windows PowerShell.
- Check if the Memory Compression is enabled by copy-pasting:
- “
Get-MMAgent
”
- “
- Look for “MemoryCompression” and check if it says True (enabled) or False (disabled).
- Close Windows Terminal if you’re satisfied with the status.
Step 2: Enable/disable Memory Compression using PowerShell
You’ll want to open PowerShell again to turn on or off Memory Compression. Afterward, copy and paste the script to enable or disable the feature:
- To enable:
Enable-MMAgent -mc
- To disable:
Disable-MMAgent -mc
Step 3: Restart the SysMain service
Memory Compression relies on the SysMain service. You’ll need to restart the service once you enable or disable Memory Compression by copying and pasting the following code:
Restart-Service SysMain
To check its status:
Get-Service SysMain
If disabled, Memory Compression may not function correctly. You may also need to restart the device to apply the changes.
Memory Compression PowerShell commands
Take note of the following PowerShell commands for future reference:
Command | Purpose |
Get-MMAgent | Checks the current configuration of the Memory Manager Agent and the MemoryCompression status |
Enable-MMAgent -mc | Enables Memory Compression |
Disable-MMAgent -mc | Disables Memory Compression |
Restart-Service SysMain | Restarts the SysMain service, which is tied to performance optimization |
Get-Service SysMain | Checks the current status (Running/Stopped) of the SysMain service |
Things to consider before disabling Memory Compression
Turning Memory Compression on or off in Windows 11 affects device performance, so knowing its effects is crucial. For one, Memory Compression affects RAM usage, which may offer little benefit to high-end computers. Here are other things you need to keep in mind before turning the feature on or off:
Performance impact
Memory compression compresses memory pages in RAM to avoid using slower pagefiles on disk. This improves performance and responsiveness on low-RAM systems because reading compressed data from RAM is faster than reading uncompressed data from the hard drive.
However, there’s enough physical memory to avoid paging on high-RAM systems, meaning compression won’t amount to anything. It may even add unnecessary CPU overhead.
Virtual machines
In virtual environments, the hypervisor will likely use memory management techniques like ballooning to allocate RAM across virtual machines.
If the guest OS (in this case, Windows) performs Memory Compression, this could conflict with the hypervisor’s memory controls, leading to inefficiencies. It’s best to test Memory Compression with your hypervisor setup before broadly enabling it.
Task Manager visibility
You can confirm the status of Memory Compression using the Task Manager:
- Press Ctrl + Shift + Esc.
- Go to Performance > Memory.
- Look for “In use (compressed).“
Third-party tools
PC optimization or performance tools like registry cleaners or RAM optimizers may automatically adjust system settings, including Memory Compression. This may result in conflicts, especially if a tool re-enables compression after disabling.
If you want to reliably control Memory Compression, disable or avoid third-party tools that may change system memory settings.
Improve performance by enabling Memory Compression in Windows 11
Memory Compression is a feature that reduces the data size to allow the computer to store more files in physical memory than it usually would. If you’re using a device with limited RAM (4 to 8GB), it’s best to keep compression enabled to improve performance and responsiveness. To do so, open PowerShell and enter “Enable-MMAgent -mc.”
If you plan to disable Memory Compression, only do so if your device has enough RAM (16GB+). Also, consider testing Memory Compression with your hypervisor setup before enabling it to ensure the two techniques won’t conflict and lead to inefficiencies.