87

Since I upgraded to Windows 10, my system has been consuming RAM excessively

enter image description here

I've been reading a bit and determined it's likely a driver leaking memory. So I got myself the Windows Driver Kit and tracked memory usage with poolmon:

enter image description here

However, I don't really know how to proceed from here. Is the item tagged "smNp" the culprit in this issue? How do I go from there to actually identifying the driver?

I tried some stuff like "C:\Windows\System32\drivers>findstr /s smnp ." but it returned no results. I also took a look at the pooltag.txt file and this is the description I found for it:

enter image description here

So yeah, any help would be appreciated. Thanks in advance.

3
  • 1
    ok, I added the information that was able to find. Check them Aug 18, 2015 at 19:39
  • 1
    This is a feature of the system to actually keep more things in RAM by using compression instead of paging to disk. @magicandre1981 has the right info here which should be accepted as the right answer. Nov 8, 2015 at 7:33
  • The 14 megabytes that poolmon shows is associated with the smNp tag is a purely trivial amount. You're worried about 1.3 GB in the System process private working set - why focus on 14 MB of nonpaged pool (which isn't in any process's working set, at all)? Mar 20, 2017 at 9:26

4 Answers 4

14

By going into services.msc (via Win+R) and disabling Superfetch completely solves this. I am not sure if Superfetch is just broken as of now or it's "by design".

In addition, apparently getting rid of the paging file will have the same effect but the above solution is a safer bet.

20
  • 1
    This actually worked. Memory usage for System is back to ~0.1MB even after hours of use. Thanks!
    – Nayncore
    Aug 10, 2015 at 17:53
  • 26
    While typically such high memory usage would be a red flag for a memory leak, this memory is being used legitimately as a FEATURE of Windows 10 (see magicandre's answer below).
    – Bigbio2002
    Aug 18, 2015 at 19:48
  • 7
    it's not a bug and shouldn't be disabled
    – phuclv
    Aug 26, 2015 at 15:45
  • 1
    lifehacker.com/…
    – phuclv
    Aug 26, 2015 at 15:45
  • 6
    If the feature causes constant low memory warnings it is not good feature. Now my Surface Pro with 4GB RAM is completely unusable for development and even on laptop with 8GB RAM I constantly get those warnings. Thumb up for solution!
    – Oleg I.
    Sep 22, 2015 at 19:10
99

I've looked at xperf traces of several users and here the function ntoskrnl.exe!SmKmStoreHelperWorker of the Kernel starts to allocate memory.

Screenshot
(Click image to enlarge)

I discovered this on sysinternals.

I've asked Microsoft about it and the answer is that this is by design. It is related to System Memory compression.

In the announcement of Windows 10 Build 10525, Microsoft explained it a bit:

In Windows 10, we have added a new concept in the Memory Manager called a compression store, which is an in-memory collection of compressed pages. This means that when Memory Manager feels memory pressure, it will compress unused pages instead of writing them to disk. This reduces the amount of memory used per process, allowing Windows 10 to maintain more applications in physical memory at a time. This also helps provide better responsiveness across Windows 10. The compression store lives in the System process’s working set. Since the system process holds the store in memory, its working set grows larger exactly when memory is being made available for other processes. This is visible in Task Manager and the reason the System process appears to be consuming more memory than previous releases.

So instead of writing memory data to the pagefile it compresses them. And this compressed memory is shown in the System process.

Microsoft also posted more details in the inside hub. Winbeta created a article which includes more details.

Apparently, the reason for this happened to do with Microsoft choosing to suspended UWP apps when they were not in the foreground, very similar to some smartphone OS management. Windows 8 users understood (perhaps not) that if apps weren’t on screen, they wouldn’t run until the user switched back to them. The ‘all or nothing’ approach is being updated with Windows 10 introducing a layer between the pagefile and normal paging activity. Now, when faced with memory pressure issues, MM will determine which pages should be moved to the modified list in a process called trimming. The modified list is a secondary list of pagefiles backing up a list of standby pagefiles. A backup list is captured in case memory is reclaimed from the standby list by another process, and the original process comes looking for its page. Instead of all or nothing, Windows 10 MM will compress unused pages rather than writing them to disk. With less writing, the result should be fewer disk operations – thanks to the compression – and now more data can be stored in memory.

enter image description here

According to the Windows team, “In practice, compressed memory takes up about40% of the uncompressed size, and as a result of a typical device running a typical workload, Windows 10 writes pages out to disk only 50% as often as previous versions of the OS.” If all goes according to plan, Windows users could be experiencing reduced waiting times for all devices as well as extended lifespans on systems that have flash-based hard drives.

Decompression is also something Windows 10 is designed to do well. Windows 10 is using the combination of parallelizability and sequential reads to produce pages into memory once called. The new decompression should result in a speedier experience as Windows 10 is simultaneously decompressing data and reading it in parallel using multiple CPUs. Older versions of Windows may have felt sluggish because of the transfer rates between the disk.

Microsoft also released a Video on channel9 which explains the feature.

Memory Compression in Windows 10 RTM
https://channel9.msdn.com/Blogs/Seth-Juarez/Memory-Compression-in-Windows-10-RTM

In this video Mehmet Iyigun spent some time discussing why the System process in Windows 10 is taking a bit more memory and why it's a good thing. A process taking more memory sounds like a bad thing - that is until I understood more about memory management, paging, and hard / soft page faults. Turns out that that the OS is doing some clever optimizations that allow your processes to trim some of the memory but not necessarily page it out to disk. Not only is the memory preserved in RAM, but it is also compressed - making hard page faults a more rare occurrence. The results should make for a snappier experience.

In the latest TH2 Builds, Microsoft updated the description in the task manager and now also shows that the SYSTEM process hosts the compressed memory:

enter image description here

to avoid confusions about the "high" usage.

In the Window 10 Anniversary Update which was released in August 2016, Microsoft extracted the Compression into now shown in a pseudo process called Memory Compression to no longer confuse users why SYSTEM has such a large memory usage:

enter image description here

But it looks like Taskmgr doesn't show this process, only ProcessExplorer/ProcessHacker are able to show it. The Taskmgr only shows the amount of compressed memory in the overview:

enter image description here

If you hover over the used memory graph in Taskmgr you see a tooltip that shows the amout of data that are compressed.

enter image description here

In this demo 388MB are compressed to 122MB so 267MB are saved with the compression.

17
  • 9
    @Zaibis: I think the idea is that you're not "dropping 1GB". 1GB has been reserved by Windows and will be used for allocations. You haven't lost the memory. Aug 7, 2015 at 10:12
  • 12
    "Unused memory is wasted memory" has long been the mantra of OS X. Looks like Windows got on board too.
    – deceze
    Aug 7, 2015 at 12:32
  • 1
    @magicandre1981 What do you mean bySystem Memory compression Aug 7, 2015 at 12:49
  • 2
    I can't answer this in details. I only got the information that it is by design, has something to do with a memory compression and this will be explained by a blogpost. When I get new information, I'll update my post. Aug 7, 2015 at 20:53
  • 3
    @JosiahKeller The "low memory" dialog is about low virtual memory. It has almost nothing to do with use of, or availability of, physical memory (RAM). They're accounted separately by all modern desktop OSes. Sep 9, 2015 at 20:06
0

I found an outlier case that causes high System memory usage, and wanted to include it in case this information benefits anyone.

If you heavily utilize Microsoft's Volume Snapshots (the software snapshot, not the hardware snapshot), the more snapshots you keep combined with large data changes, then System will consume more RAM.

Normally the amount of RAM used for Volume Snapshots is small and will not be noticed, unless you have a giant volume (i.e. 64 TB) with multi-terabyte deltas between snapshots. By default, snapshots will simply delete themselves if write IO's get too high, but there are ways to prevent that, allowing you to reach massive deltas.

Below is an extreme case showing a server's System process using 13GB of RAM. This server has only two Volume Snapshots, taken 15 days apart, with around 10 TB of data written in between each snapshot.

System Memory Usage at 13GB

The System process above was previously at 24GB of usage, and the following three behaviors were observed:

  1. After a reboot and logging back in, the system would hang for a period of time at a blank screen until the desktop would appear.
  2. During this hang, pulling up Task Manager (CTRL-SHIFT-ESC) showed the System memory usage growing.
  3. During this hang, the disk with the Volume Snapshots performed a lot of reads that did not show up in Performance Monitor. Though, because the disk utilized iSCSI, the network card showed a steady read stream around 200 Mbps.

I suspected Volume Snapshots, so I tried deleting the oldest snapshot which instantly dropped System's memory usage from 24 GB to 13 GB.

Under these circumstances this may be normal behavior, though I have not confirmed this with Microsoft. In the meantime I will be adding an additional 32 GB of RAM to this server to handle the Snapshot overhead.

(Note: this is a high volume backup server running Windows 2016 with a 64 TB SSD iSCSI drive attached. It maintains an average of three volume snapshots at any given time, with a new one created every 15 days. There is around 10 TB of data written in between each snapshot).

-2

Disable prefetcher in regedit key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters you probably have Enable Prefetcher at a value of 2 or 3 so change it to 0

Next you need to disable Superfetch in services

  1. Search for services.msc

  2. Find superfetch click properties then set it to disabled and stop the service as well.

I do these steps and when I am gaming and normally using PC and the system process uses only 28k

2
  • 12
    This is a horrible idea. Prefetch/superfetch are used for a reason. If you think you can manage memory better than your OS, you're sadly mistaken.
    – arkon
    Nov 20, 2015 at 4:00
  • Disabling prefetch (or "cleaning out your prefetch folder") is indeed a very silly idea. Prefetch does not cause the system to use any more RAM. It speeds up the loading of exe's and dll's once you start them, and only then. Re SuperFetch, Microsoft does disable SuperFetch by default on systems with an SSD for the Windows drive; they feel the benefit is not worth it. Personally I keep it enabled because I have other drives, non-SSDs, that I want SF to still operate on. May 14, 2016 at 20:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .