Windows 10, 'System' process taking massive amounts of RAM

82

32

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.

Nayncore

Posted 2015-08-07T04:17:19.997

Reputation: 998

1ok, I added the information that was able to find. Check them – magicandre1981 – 2015-08-18T19:39:49.200

1This 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. – Mani Gandham – 2015-11-08T07:33:09.067

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)? – Jamie Hanrahan – 2017-03-20T09:26:43.467

Answers

13

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.

den

Posted 2015-08-07T04:17:19.997

Reputation: 242

1This actually worked. Memory usage for System is back to ~0.1MB even after hours of use. Thanks! – Nayncore – 2015-08-10T17:53:38.373

@den Is it OK to stop this process? Isn't this harm to the computer? – Ido Naveh – 2015-08-17T13:59:23.927

26While 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 – 2015-08-18T19:48:47.520

7it's not a bug and shouldn't be disabled – phuclv – 2015-08-26T15:45:11.373

http://bgr.com/2015/08/20/windows-10-system-process-ram/ – phuclv – 2015-08-26T15:45:16.517

1as Windows User, i do not find any logic reason to disable Superfetch feature, i really want my computer run faster, preloading my commonly used app in memory. – Francisco Tapia – 2015-09-16T18:53:40.330

6If 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. – 2015-09-22T19:10:45.787

@OlegI. If you're running out of RAM, that just means you don't have enough. The feature just compressions stuff that's already in RAM rather than writing it to disk which speeds up access. It's not taking up any more RAM than the apps you're running already are and disk reads are only going to make your system seem slower. Seems you might just be running too much stuff. – Mani Gandham – 2015-11-08T04:21:15.600

@ManiGandham i just got a win10 laptop. been getting low mem warnings for the last couple nights. I have 32gb of ram and I use about 5gb of ram when I'm not developing. When I leave the laptop on overnight, I'm left with 19gb free, 8gb of which is in the system process, and still have "low" memory warnings. Somehow I doubt getting 64gb of ram would help much. – ton.yeung – 2015-11-08T04:58:46.823

@OlegI. You're saying you're getting this warning now on 3 different machines? I think there's something else you're doing or running that's causing those warnings, if they're actually coming from Windows itself. – Mani Gandham – 2015-11-08T07:30:54.557

1The "low memory warning" is about private committed virtual address space, not RAM. You can have plenty of free RAM and still get those warnings, because the warning is about potential future usage, not immediate. The cure is to increase your pagefile or to add more RAM. – Jamie Hanrahan – 2015-11-17T19:27:22.400

@ton.yeung You should really go read the documentation about how Windows uses RAM. Free RAM is wasted RAM. If Windows sees free RAM, it's going to do its best to allocate it ("Standby" RAM) to make your system and multitasking more responsive. Whatever issues you're having isn't the result of a faulty Windows feature. It's either the result of malware, broken driver(s), broken 3rd party application(s), or you've screwed up your pagefile settings. – b1nary.atr0phy – 2015-11-20T04:16:18.963

1I doubt that. First thing i did was wipe the machine, install drivers, and install chrome. – ton.yeung – 2015-11-20T14:13:37.320

1@JamieHanrahan add more ram than 32gb? What you guys are saying may be correct. It doesn't change the fact that the behavior windows is exhibiting is stupid. I have 32 gb of ram already, and I'm getting advice to add more? I don't know about you, but to me that's absurd. – ton.yeung – 2015-11-20T14:16:26.217

@ton.yeung I understand your frustration. The "low memory" warnings have nothing to do with how much free RAM you have. They appear when a process tries to allocate private committed virtual address space ("commit" for short) that would exceed the "commit limit". The commit limit is the sum of your RAM size (again, not just free RAM!) plus your current pagefile size. So the primary problem is not that something is using lots of RAM, but that it's using lots of commit. Please open a new Q with shots of task manager's "Performance" tab, plus the "details" tab sorted by "Commit size". – Jamie Hanrahan – 2015-11-21T02:40:54.123

I confirm that solution works. After stopping Superfetch, disk activity immediately drops from 100% to 15%. I recommend though to only stop the process when need and not disabling it. – Jhourlad Estrella – 2015-12-04T16:57:56.953

Just confirming that this applies to all windows versions that can do caching like that.

Any windows version that attempt to fill the entire RAM, can have EXTREMELY poor performance by constantly adding random junk to the ram, for example I saw windows chaching on the ram a multi-gb file from a game, it was the music of the game, when I went to work after playing the game, the HDD would work hard to load that file to the RAM every single time it could fit, resulting in constant HDD reading, and programs waiting to use the RAM as windows deleted the thing from the RAM again. – speeder – 2016-05-20T03:00:04.583

To see the contents of your RAM (including all the files windows decided to put in it as cache), use the program "RAMMap" from Sysinternals: https://technet.microsoft.com/en-us/sysinternals/rammap.aspx

– speeder – 2016-05-20T03:00:51.213

1Just want to say that I tried this and my disk and ram usage went down exponentially. Performance improved significantly, and all I was doing was surfing the internet on chrome. I think there may be something wrong with "superfetch" that could cause it to impair performance. – Twilight Sparkle – 2016-11-12T23:02:58.193

93

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.

magicandre1981

Posted 2015-08-07T04:17:19.997

Reputation: 86 560

Is this kidn of a bug or is this usual for windows 10? I was thinking about to upgrade but i have only 3GB available and droping 1GB of it jsut for win 10 is not aceptable for me. so will this happen on every windows10? – Zaibis – 2015-08-07T09:58:14.967

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. – Lightness Races with Monica – 2015-08-07T10:12:41.253

@LightnessRacesinOrbit: Ah thanks for the information. – Zaibis – 2015-08-07T10:23:45.713

@Zaibis: For the record, I'm only guessing! We should wait for the blog post, I guess. – Lightness Races with Monica – 2015-08-07T10:24:41.017

12"Unused memory is wasted memory" has long been the mantra of OS X. Looks like Windows got on board too. – deceze – 2015-08-07T12:32:58.190

1@magicandre1981 What do you mean bySystem Memory compression – user2284570 – 2015-08-07T12:49:35.367

@deceze I remember there was actually a similar uproar about Vista appearing to use huge amounts of memory, when it was (just like this time) only used for caching and not actually "in use". – nkorth – 2015-08-07T13:15:18.553

1@deceze Windows got "on board" with Vista already, so it's nothing new. It didn't make that much sense back in the XP days when desktops didn't really have any RAM left over anyway. Server Windows had this long before, at least since NT 4.0 (although the Vista generation was still a major improvement of the mechanism). – Luaan – 2015-08-07T14:03:55.133

1I'm not sure I buy this, because just last night I had this same thing happen and the only reason I noticed was because I got a "Low memory" dialog. If the system were intentionally reserving the memory, why would it have to warn me about it? – Josiah Keller – 2015-08-07T17:51:25.863

2I 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. – magicandre1981 – 2015-08-07T20:53:50.713

1@magicandre1981 Looks like Windows is following Linux Zram years after :) – user2284570 – 2015-08-18T19:53:19.263

@user2284570 I have no idea. I don't use Linux that much. – magicandre1981 – 2015-08-18T19:54:16.017

@magicandre1981 Zram is the equivalent on Linux which does exactly the same thing. It was put in mainline 2 years ago. – user2284570 – 2015-08-18T19:55:50.330

2@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. – David Schwartz – 2015-09-09T20:06:07.327

Though unrelated, I would like to add that I've been experiencing many query timeout errors running SQL Server 2014 (both Enterprise and Express editions) on a Windows 10 machine with 4GB of RAM. I noticed that the System process was using upwards of 600MB of RAM because of the reasons detailed in this answer, and combined with multiple browser tabs, Outlook, and other programs, SQL Server was not able to obtain a memory grant, which was the ultimate cause of the timeout errors. The solution for me was to increase to 8GB of RAM. – John Rasch – 2015-10-05T23:05:07.750

When was this update released? My SYSTEM is still merged with Memory Compression. – boxspah – 2016-03-19T03:43:22.347

1@scriptHero this update is not released yet. You have to install the latest Insider Preview Build to see it. This Redstone 1 update will be released later this year. – magicandre1981 – 2016-03-19T07:22:42.673

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).

Brain2000

Posted 2015-08-07T04:17:19.997

Reputation: 376

-1

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

Grzesiek Grzychu Góra

Posted 2015-08-07T04:17:19.997

Reputation: 33

12This 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. – b1nary.atr0phy – 2015-11-20T04:00:48.537

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. – Jamie Hanrahan – 2016-05-14T20:09:11.577