How to disable Windows 10 memory compression?

204,356

Solution 1

This is a good feature to avoid paging (writing data to pagefile.sys on the HDD) .

If you want to test your Windows 10 without memory compression, start powershell as admin

enter image description here

and run the command Disable-MMAgent -mc and reboot. This disables the compression. To enable it later again, run again powershell as admin and run the Enable-MMAgent -mc command.

Solution 2

You can check the full answer at What is the cause of a high CPU usage of 'system and compressed memory' in Windows 10?. But for a short version:

I went to:

Start->Control Panel->Administrative Tools->Task Scheduler->Task Scheduler Library->Microsoft->Windows->MemoryDiagnostic

(To make this option visible, you need to run the "Task Scheduler" as Administrator!)

There are two line items. Running of the task may be dependent upon log events. I'm not sure if they just have to exist, or if they trigger upon entry into the log. In any case, I disabled the entry labelled as RunFullMemoryDiagnosticEntry. That solved my instance of the problem.

If this doesn't solve your issue, instructions earlier in the answer suggest using the Windows Performance Analyzer to help find a solution.

Share:
204,356

Related videos on Youtube

Falco Alexander
Author by

Falco Alexander

programming since 1984 but trying to improve from old fashioned pascal, basic and assembler cowboy style to clean patterns .NET C#

Updated on September 18, 2022

Comments

  • Falco Alexander
    Falco Alexander over 1 year

    my former wrong assumption: it drains my notebook battery and I've no shortage of RAM. In Task manager you see ntoskrnl.exe is eating more CPU time than any other process. this feature does not appear to be optional and came 2 days ago with the 1st Win10 Update (Win10Pro in my case).

    Edit:

    I want to disable it, at least to exclude it as a culprit for my (unproven) assumptions. That process never came to my attention in the last 2 months and in task manager's long name it's called "system memory and compressed memory".

    • Sami Kuhmonen
      Sami Kuhmonen over 8 years
      Are you sure that is the issue? If you have no shortage of RAM, the compression will not be used. And there is a separate process showing for the compression, if it is being used.
    • Falco Alexander
      Falco Alexander over 8 years
      It's called by that name in task manager. And being able to disable compression would help to nail
    • ZippyV
      ZippyV over 8 years
      Memory compression has been in Windows 10 since the beginning. If you have battery issues since this week it's not because of this feature. The kernel does a lot more than just memory compression. It makes all applications work on your system.
    • AFH
      AFH over 8 years
      What makes you think that memory compression is the problem? Have you used a detailed process analyser? If not, you should. As @ZippyV says, ntoskrnl.exe handles all core functions, and there are many of them, so I see no reason to single out memory compression as the culprit.
    • Falco Alexander
      Falco Alexander over 8 years
      let's call it intuition! as nobody seems to be able to help, I will try to profile the process. I edited the questions to fit better.
    • Falco Alexander
      Falco Alexander over 8 years
      @AFH et al. you were right: I could trace it down with procexpl and perfview to be a problem with a bridge.sys driver eating much CPU in one of the ntoskrln threads. This was obviously related to my virtual switch from hyper-v. I could remove and reinstall that v-switch and CPU consumption is back to normal. Nevertheless I am still interested in knowing to disable the compression, just to know it :)
    • Ramhound
      Ramhound over 8 years
      You can't. You never could.
    • magicandre1981
      magicandre1981 over 8 years
    • magicandre1981
      magicandre1981 over 8 years
      this is no new feature of the update. This feature is already part of the first release, see the duplicate link.
    • Falco Alexander
      Falco Alexander over 8 years
      this question is not duplicate, different focus (no memory involved), but it is/was indeed not related to update1, so I removed two words from subject.
  • arod
    arod almost 8 years
    Sounded logical, so I tried it. But the problem returned. : /
  • Admin
    Admin almost 8 years
    Would it be possible to configure Windows 10 so that is uses the page file more often than what it already does by default, and uses the compression less often? From what I've seen online, it appears as though any attempts to completely disable the new memory management scheme yield little-to-no results. I'm sporting and AMD E-Series APU with 4 GB of ram, and no possibility of a memory upgrade. Laptops hurt.
  • fostandy
    fostandy almost 8 years
    Can I just confirm that this definitely and definitively disables memory compression? I toggled this a couple of days ago, but last night on (yet another freeze) I noticed procexp reporting utilisation during one of my increasingly frequent system freezes imgur.com/a/iPKY2
  • Raymond Burkholder
    Raymond Burkholder almost 8 years
    The answer isn't easy. One setting doesn't fix everyone's problem. Everyone's system is different and has different issues at heart. And different things are installed. But... in the link I offered, I show the way I found out what my particular issue was. That tool set is general enough that it may help you find the root issue and over a specialized solution for your particular environment. Or, ... dare I say it... find someone who can run the tools for you, read the tea leaves, and figure something out. :-)
  • Kevin
    Kevin over 7 years
    Thanks for your answer. Regarding "good feature to avoid paging". I'd argue it depends. I was developing software with a heavy IDE on a ULV processor with a decent amount of ram and fast SSD. Ignoring the "out of memory" exceptions I'd get with the feature ON, I'd still prefer the occasional page file IO over the CPU hit.
  • magicandre1981
    magicandre1981 over 7 years
    @Kevin no, paging and IO is more expensive in term of responsiveness of a OS
  • user184411
    user184411 over 7 years
    @magicandre1981 It ain't necessarily so. I have 16GB of RAM, and memory compression typically uses 3GB and up to 5 GB. I get windows popping up telling me that I am out of memory and suggesting that I kill some application. There is no question that I would be better off without memory compression, having slower paging but keeping may applications running.
  • Souhaieb Besbes
    Souhaieb Besbes over 7 years
    I will add that you can use Get-MMAgent prior to this command to confirm the current state of memory compression among other things.
  • TombMedia
    TombMedia almost 7 years
    Does this only work on certain version of win10? I can't get the disable command to work with -mc nor -memorycompression
  • magicandre1981
    magicandre1981 almost 7 years
    @TombMedia this command was added in v1607, so maybe you still use 1507 LTSB or v1511
  • ajeh
    ajeh about 6 years
    Disable-MMAgent : The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. What service???
  • magicandre1981
    magicandre1981 about 6 years
    @ajeh have you disabled superfetch?
  • ajeh
    ajeh about 6 years
    Most likely I have. Is that the service the command requires?
  • magicandre1981
    magicandre1981 about 6 years
    @ajeh don't disable this service.
  • magicandre1981
    magicandre1981 about 6 years
    @ajeh this service controls the prefetching and this compression. why do you disable it? even if you have a SSD leave it on, since Win8 Superfetch skips SSDs and doesn't load data from here.