Memory compression in Windows 11 compresses parts of the system memory to reduce the amount of data written to the page file. When the page file grows unusually large or the system becomes sluggish under moderate memory loads, memory compression may be masking underlying page file pressure. This article explains how to temporarily disable memory compression using PowerShell to determine whether page file pressure is the root cause of performance issues. You will learn the exact commands to toggle memory compression off and on, how to interpret the results, and what to do if the page file remains under pressure after compression is disabled.
Key Takeaways: Diagnosing Page File Pressure by Disabling Memory Compression
- PowerShell command
Disable-MMAgent -MemoryCompression: Turns off memory compression immediately without a reboot on Windows 11 22H2 and later. - Performance Monitor counter
Memory\Pages\sec: Measures page file activity; sustained values above 1,000 indicate page file pressure. - Task Manager > Performance > Memory: Shows compressed memory size; if it drops to zero after disabling compression, memory was being over-relied on for compression instead of the page file.
What Memory Compression Does and Why It Affects Page File Pressure
Memory compression is a feature introduced in Windows 10 and carried forward into Windows 11. It stores inactive pages in a compressed format within system memory (RAM) instead of writing them to the page file on disk. The goal is to reduce disk I/O and improve responsiveness when memory is under moderate load.
When memory compression is active, the system may appear to have adequate free memory even when the page file is growing. This happens because compressed pages consume less RAM than their uncompressed equivalents, artificially lowering the reported memory usage. If the page file is growing beyond 1.5 times the amount of physical RAM, or if the system becomes sluggish during normal workloads, page file pressure may exist. Disabling memory compression forces the system to use the page file directly, making the true memory demand visible.
You need administrator privileges on Windows 11 to run the PowerShell commands. The procedure is reversible and does not modify registry keys or system files permanently.
Steps to Disable Memory Compression and Diagnose Page File Pressure
Follow these steps to disable memory compression, monitor page file activity, and then re-enable compression after diagnosis.
- Open PowerShell as Administrator
Press the Windows key, type PowerShell, right-click Windows PowerShell in the search results, and select Run as administrator. Confirm the User Account Control prompt. - Check Current Memory Compression Status
Run the commandGet-MMAgent. Look for the line MemoryCompression. If it shows True, compression is currently enabled. - Disable Memory Compression
Run the commandDisable-MMAgent -MemoryCompression. No confirmation message appears. RunGet-MMAgentagain to verify the value shows False. - Restart the Computer
On Windows 11 versions before 22H2, a restart is required for the change to take effect. On 22H2 and later, the change applies immediately. Restart anyway to clear any cached compressed pages from memory. - Monitor Page File Activity
Open Task Manager (Ctrl+Shift+Esc), go to the Performance tab, and select Memory. Observe the Compressed value — it should be 0 MB. Then open Performance Monitor by typing perfmon in the Start menu. Add the counter Memory\Pages/sec. A sustained value above 1,000 pages per second indicates page file pressure. - Perform Your Normal Workload
Use your computer as you normally would for 30 to 60 minutes. Note any changes in system responsiveness, application launch times, or disk activity. - Re-enable Memory Compression
Run PowerShell as Administrator again and executeEnable-MMAgent -MemoryCompression. Restart the computer to apply the change. RunGet-MMAgentto confirm the value is back to True.
If Page File Pressure Persists After Disabling Memory Compression
If the Memory\Pages/sec counter remains above 1,000 even with compression disabled, the page file is under genuine pressure. The following sections cover common scenarios and their fixes.
Page File Grows Beyond 4 GB During Light Workload
If the page file expands to more than 4 GB while you are only running a browser and a few apps, a memory leak in a driver or application is likely. Open Task Manager, go to the Details tab, and sort by Commit size. Identify the process using the most private bytes. Update or uninstall the associated software. If the process is a third-party driver, use Settings > Windows Update > Advanced options > Optional updates > Driver updates to install the latest version.
System Becomes Unresponsive When Compression Is Off
If the system becomes nearly unresponsive after disabling compression, the page file is too small for the current workload. Open Settings > System > About > Advanced system settings, click Settings under Performance, go to the Advanced tab, and click Change under Virtual memory. Uncheck Automatically manage paging file size for all drives, select the drive where Windows is installed, choose Custom size, and set the initial and maximum size to 1.5 times your physical RAM. For example, with 16 GB RAM, set both values to 24576 MB. Click Set, then OK, and restart.
Compressed Memory Remains High After Re-enabling Compression
After re-enabling compression, Task Manager may show a compressed memory value of several gigabytes. This is normal if you have many applications open. If the value stays above 50% of total RAM during idle time, check for background processes consuming memory. Run tasklist /fi "status eq running" in Command Prompt to list active processes. Close unnecessary startup apps using Settings > Apps > Startup.
Memory Compression Enabled vs Disabled: Diagnostic Behavior
| Item | Memory Compression Enabled | Memory Compression Disabled |
|---|---|---|
| Page file usage | Reduced — compressed pages stay in RAM | Full — all inactive pages go to page file |
| Reported free RAM | May appear higher due to compression | Accurate representation of available memory |
| Diagnostic value | Hides page file pressure until RAM is saturated | Reveals true page file demand immediately |
| System responsiveness | Better under moderate load | May degrade if page file is undersized |
| Reboot required | No (change applies immediately on 22H2+) | Yes (for versions before 22H2) |
Memory compression is a performance feature that can mask page file pressure during diagnosis. By temporarily disabling it, you can observe the true page file activity and decide whether to increase the page file size or investigate a memory leak. After the diagnosis, re-enable compression to restore normal memory management behavior. For persistent page file pressure, check the page file custom size setting and update problematic drivers.