/
/

Enable or Disable Memory Compression in Windows 11

by Grant Funtila, Technical Writer
Enable or Disable Memory Compression in Windows 11 blog banner image

Instant Summary

This NinjaOne blog post offers a comprehensive basic CMD commands list and deep dive into Windows commands with over 70 essential cmd commands for both beginners and advanced users. It explains practical command prompt commands for file management, directory navigation, network troubleshooting, disk operations, and automation with real examples to improve productivity. Whether you’re learning foundational cmd commands or mastering advanced Windows CLI tools, this guide helps you use the Command Prompt more effectively.

Key points

  • Improve RAM Efficiency: Windows 11 Memory Compression reduces memory pressure by compressing inactive memory pages in RAM before paging to disk.
  • Enabled by Default: Memory Compression is turned on by default in Windows 11 and is managed by the Windows Memory Manager.
  • Use PowerShell: “Get-MMAgent” to check Memory Compression status, “Enable-MMAgent -mc” to enable, and “Enable-MMAgent -mc” to disable.
  • Reduce Pagefile Usage: Compressed memory is stored in RAM, which is significantly faster than paging to disk.
  • Disabling Memory Compression Is Rarely Necessary: For most systems, Memory Compression provides benefits with minimal CPU overhead.
  • Monitor Compressed Memory: Open Task Manager → Performance → Memory and review the “In use (compressed)” value to see real-time activity.

Windows 11’s Memory Compression helps the system use RAM more efficiently. When RAM fills up, Windows first compresses inactive memory pages and keeps them in RAM. Only when compressed memory is insufficient does Windows page data to 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 this feature 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 of the feature should help determine if you need to proceed to the next steps.

  1. Press Win + X, click Terminal (Admin), and select Windows PowerShell.
  2. Check if the Memory Compression is enabled by entering this command:
    • Get-MMAgent
  3. Look for “MemoryCompression” and check if it says True (enabled) or False (disabled).
  4. Close the 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 appropriate script to enable or disable the feature:

  • To enable:

Enable-MMAgent -mc

  • To disable:

Disable-MMAgent -mc

Step 3: Restart the SysMain service

While Memory Compression relies on the SysMain service is part of the Windows Memory Manager and doesn’t strictly require the SysMain service to function, SysMain improves overall memory optimization behavior. Once you’ve enabled or disabled Memory Compression, you can restart the service by copying and pasting the following code:

Restart-Service SysMain

To check its status. run this command:

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:

CommandPurpose
Get-MMAgentChecks the current configuration of the Memory Manager Agent and the MemoryCompression status
Enable-MMAgent -mcEnables Memory Compression
Disable-MMAgent -mcDisables Memory Compression
Restart-Service SysMainRestarts the SysMain service, which is tied to performance optimization
Get-Service SysMainChecks 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, and Memory Compression operates alongside such techniques. In most modern setups, this works without issue, but testing in production environments is recommended.

Task Manager visibility

You can confirm the status of Memory Compression using the Task Manager:

  1. Press Ctrl + Shift + Esc.
  2. Go to Performance > Memory.
  3. 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 this command:

Enable-MMAgent -mc

On systems with 32GB or more RAM, the performance impact of memory compression is typically negligible, and disabling it is rarely necessary. Also, consider testing Memory Compression with your hypervisor setup before enabling it to ensure the two techniques won’t conflict and lead to inefficiencies.

Check out the short table below for recommended actions in specific RAM scenarios:

ScenarioRecommendation
4–8GB RAMKeep enabled
16GB RAMKeep enabled
32GB+ RAMOptional
Gaming PCKeep enabled
Enterprise VMTest before changing

 

FAQs

Memory Compression can briefly increase CPU usage when the system is under heavy memory pressure. This is normal behavior as Windows compresses inactive memory pages instead of paging them to disk.

If CPU usage stays high, check for background apps consuming excessive RAM, update Windows, and ensure SysMain is running. Persistent high CPU may indicate insufficient RAM or conflicting third-party optimization tools.

If Get-MMAgent doesn’t display a MemoryCompression entry, make sure you’re running PowerShell as an administrator. Also confirm you’re using Windows PowerShell or Windows Terminal with elevated privileges.

If the issue persists, verify your Windows 11 version is up to date as older builds may display settings differently.

If you don’t see “In use (compressed)” in Task Manager under Performance → Memory, your system may not currently be compressing memory. Windows only shows compressed memory when it’s actively being used. Try opening multiple applications to increase RAM usage and check again.

This error usually appears when PowerShell isn’t running with administrative privileges or when the command is typed incorrectly.

Open Terminal (Admin), ensure there are no spelling errors, and confirm you’re using PowerShell rather than Command Prompt. The command won’t work in standard CMD without PowerShell context.

In many cases, changes apply immediately after running Enable-MMAgent -mc or Disable-MMAgent -mc.

However, restarting the SysMain service or rebooting your device ensures the new configuration is fully applied and avoids temporary inconsistencies.

You might also like

Ready to simplify the hardest parts of IT?