79

How does one diagnose/discover memory-related problems, if Task Manager appears to not be reporting correctly?

I must have a memory leak or something -- I'm at 75% usage of my 12 GB of memory, but Task Managers listings of processes' memory usage isn't adding up (yes, "Show processes from all users" is checked).

It seems like this "phantom" memory usage grows in relation to how long the system's been up. It shows that there are 118 total processes. Besides the top 5, all of them are under 50 MB.

The top process is firefox, using 2.6 GB. Adobe Premiere at 900 MB. Plugin-container at 300 MB. Pale Moon at 275 MB. Explorer.exe at 94 MB.

How in the world can I find what's using up the rest of my memory? It seems as if Task Manager isn't seeing everything that's being used. Perhaps there's some kind of memory leak? Or program's aren't releasing used memory properly?

Resource Monitor reports (click for larger version):

Resource Monitor Printout

NOTE:

  1. As my main OS drive is an SSD, SuperFetch is disabled on my system.
  2. And I understand the principal that unused ram is "wasted" ram, so to speak. However, when I see my memory usage nearly used to peak capacity, it's stopping me from running/loading subsequent programs (from my own concern), and even sends me to task to close many down (with hardly much effect on decreasing memory usage, at least noticeably and within short time period).
  3. When the memory fills up, I hate seeing the 1GB page file on my SSD expand to the 6GB limit I've set, and me "sweating" with the knowledge that my "poor" SSD is likely being ground down to dust as Windows heavily/rampantly turns to using it as a full-fledged memory stick. (On that note, should I just hard-cap the page file to a static 1GB?)
5
  • 4
    just a sidenote: used RAM is a not a bad thing per se. clever caching of things often speed things up. if you do not have a problem like "omg, programm xyz starts up so slow i can barely take it because of it has to throw out other things out of the ram" .. then it might be not a problem at all.
    – akira
    Jun 17, 2012 at 12:20
  • 4
  • Thanks, but since SuperFetch is disabled on my system (with the main SSD OS drive), the question is different. Updating original question. Jun 17, 2012 at 15:49
  • @Coldblackice Just because the one (unaccepted) answer doesn't help you doesn't mean it's not the same question. The OP of the other question even said changing SuperFetch didn't help. :) Jun 17, 2012 at 17:12
  • True, but it isn't the correct answer in this case, giving need for another question. Question updated to reflect this specific. Nov 2, 2012 at 17:56

6 Answers 6

66

You can usually gain better insight into what is using up your memory with tools like RamMap.

enter image description hereclick to enlarge

Often, the memory can be used up by memory mapped files that have been pulled into RAM to increase performance.

Take note of the Active column in RamMap. That is the memory that is actually currently being utilized. Indicators regarding free memory can often be misleading. This includes Windows tools like Task Manager.

Further information


I also wanted to address some additional points from your question.

However, when I see my memory usage nearly used to peak capacity, it's stopping me from running/loading subsequent programs (from my own concern), and even sends me to task to close many down (with hardly much effect on decreasing memory usage, at least noticeably and within short time period).

Your reasoning is perfectly fine. But, unless you're experiencing issues due to low memory situations, you should refrain from this practice. The operating system should handle this task and flush data out to the paging file when physical memory is required.

Possibly, you're also using the wrong indicator for your practice. You want to have an eye on your Commit Charge (Process Explorer terminology).

enter image description here

The commit charge is the sum of all used memory. You can see in the screenshot, there is also a limit to it. That limit is the size of my physical memory + the size of my paging file. If that limit was to be hit, that would be an issue.

Which brings us to our next topic.

When the memory fills up, I hate seeing the 1GB page file on my SSD expand to the 6GB limit I've set, and me "sweating" with the knowledge that my "poor" SSD is likely being ground down to dust as Windows heavily/rampantly turns to using it as a full-fledged memory stick. (On that note, should I just hard-cap the page file to a statci 1GB?)

In my opinion, there are several things wrong here. In general, it should be strongly discouraged to set limits on the size of the paging file. Mark Russinovich explains this in the videos I linked above (much better than I ever could).

Only bad things can come from that. What is Windows supposed to do when it needs to flush out more than 6GB of data to the paging file but you capped it at 6GB? That is a major issue.

Let Windows handle the paging file. The only thing I would strongly advise you to do, is moving the paging file away from your SSD. Tom Wijsman explains this excellently in his blog post Maximizing the lifetime of your SSD, which I recommend you to read.

13
  • 1
    Ahhh, I see. Yes, the "phantom" memory usage appears to be coming from the Mapped File category (and specifically, the Standby column of this). So Task Manager doesn't report these files being mapped, just that the memory is being used? Jun 17, 2012 at 15:58
  • 3
    Thanks for the help and addendum. As to your note about the page file and SSD's -- I've heard the exact opposite (and hence why I have it the way it is). Not saying that I have the definitive "right" by any means, but I've read that page file is -best- on an SSD because of the SSD's speed benefits. And as to degrading the life of the SSD, I heard that that's negligible, as long as the pagefile is limited. Jun 18, 2012 at 12:02
  • 2
    As to letting Windows manage it -- Windows wants to allow my pagefile to expand up to 18GB! Unfortunately, I can't afford that amount of space on my SSD for paging. I had presumed that 12GB of memory would be more than ample for Windows to work with, which memory, oddly enough, Windows seems to quickly slurp up as much of it available as it can, seemingly caching anything it can get its hands on :) Thus, I fear that if I let it have however big of a pagefile it wants, it will find enough files to map into memory to quickly bridge to filling up the page file in its entirety. Jun 18, 2012 at 12:11
  • 1
    @Coldblackice: I'm sorry I couldn't convince you. Please only take 1 thing away from this, there are very few people who have a proper understanding of Windows memory management. Yet, a lot of people are quick to offer recommendations (obviously, me included). Ask yourself, if limiting your paging file size is useful, why is it not the default? Also, a memory-mapped file is very unlikely to be flushed out to the paging file, because it already exists in a file (the one that was mapped to memory). So your fear in this regard is, most likely, misplaced. Jun 18, 2012 at 12:18
  • 2
    Re pagefile on an SSD, Microsoft has this to say (blogs.msdn.microsoft.com/e7/2009/05/05/…): "Should the pagefile be placed on SSDs? - Yes. Most pagefile operations are small random reads or larger sequential writes, both of which are types of operations that SSDs handle well. [...] In fact, given typical pagefile reference patterns and the favorable performance characteristics SSDs have on those patterns, there are few files better than the pagefile to place on an SSD." Sep 29, 2018 at 3:49
5

In my case the reason for high memory usage was a hyper-v virtual machine for which I had Dynamic Memory settings enabled for RAM.

RamMap tool helped me to locate the root cause.

First, I noticed in RamMap that Driver Locked consumed more then 29GB out of my 32GB RAM. Then, I found some article that explained that Driver Locked high memory usage can be caused by the HyperV Dynamic Memory enabled, and then I just confirmed that.

0
2

RAMMap showed that C:\Windows\SoftwareDistribution\DataStore\DataStore.edb mapped file was wasting 400 Mb of my precious 4 Gb RAM.

Moreover Windows Update was constantly slowing down the system in process of updating that huge file.

That may be a common problem for many lower-end PCs.

See PC Boots then writes giant datastore.edb file slowing the computer down for possible resolution.

0

If you see the snap is not showing all the process and the shown process itself taking 5.8 GB Memory. from the shown snap it show that there are a lot unnecessary background program are running. Using msconfig remove the unnecessary startup programs and also increase your virtual memory (1.5 times of your physical memory).

4
  • How do you increase your virtual memory? And what's the reasoning behind the factor 1.5? Jun 17, 2012 at 14:46
  • While increasing virtual memory (by increasing the size of the pagefile) is valuable, it may only lead to a lot of paging, which will slow the machine waaaay down. If all unnecessary programs have been prevented from running, then the best thing to do is install more RAM.
    – Fran
    Jun 17, 2012 at 16:15
  • To increase your virtual memory follow the path : Go to MY COMPUTER properties->select "Advance system settings"->go to 'advance' tab->select the "settings" under PERFORMANCE->go to advance tab->under Virtual Memory Select Change-> Select Custom size to give min. and max. size......It is recommended to increase your Virtual memory upto 1.5x of your physical memory(ex:if you have 4GB RAM then you can assign upto 6GB virtual memory). But FRANs suggestion is also correct. Please try to minimize your unnecessary background application.
    – tiki
    Jun 17, 2012 at 18:46
  • So is it proven that it's overall better to increase or decrease the page file, in terms of raw, overall performance? Is the 1.5x really necessary? Jun 20, 2012 at 17:48
0

You can try Sysinternal's RAMMAP but it shows memory usage in a different way than Task Manager & Resource Manager and is therefore not too helpful.

Task Manager & Resource Monitor don't show the filecache and the size of it. It's part of the "In use" part of the memory (See Resource Monitor). The file cache can grow to a VERY large size, especially when one keeps the computer running for hours. Overall program memory usage goes up as time goes by, as a result of a growing file cache & memory leaks. Some programs simply have a lousy memory management.

One way to minimize memory usage is reducing the amount of processes. (Why are 118 processes running ? Why do you have multiple instances of Explorer.exe running ?)

There's a program that helps you to regularly reduce memory usage & regularly collapse the file cache. (PcWinTech's CLEANMEM). Reducing memory usage this way also reduces or even eliminates the need for Windows to write data form the memory to the swapfile (on your SSD). So, it increases the lifespan of your SSD. Reducing memory usage also makes more "Standby" memory available, allowing Windows to preload more files in the Standby memory, speeding up your system.

3
  • 1
    Are you affiliated with this software? The last paragraph sounds like marketing speak to me, and I see you're recommending the same thing on 2 old posts.
    – Arjan
    May 4, 2014 at 17:36
  • 1
    Yes, I have helped the author of the program to improve the program. But I don't have any (financial) reasons to promote the program because the program is free.
    – Willy2
    May 4, 2014 at 17:47
  • Thanks for link to CLEANMEM, usefull program.
    – Pavel
    Oct 22, 2020 at 16:51
0

I was trying to find out what is eating memory in my Windows 10 - the problem is to find values which sum up into "Committed" size shown in TaskManager at Performance/Memory tab.

Unfortunatelly I could not find where to get these number from. The closesest I could find is sum of PagedMemorySize64 provided by get-process in powershell. When "Commited" in task manager was at 21.7GB, sum of PagedMemorySize64 for all processes was around 19GB - 2.7GB is still hidden somewere. If someone knows better way to get list with processes commit size - please tell it in comments.

Here is the command for powershell to dump list to file, then Excel will help to sum the numbers.

$TypeData = @{
    TypeName = 'System.Diagnostics.Process'
    MemberType = 'ScriptProperty'
    MemberName = 'CommandLine'
    Value = {(Get-CimInstance Win32_Process -Filter "ProcessId = $($this.Id)").CommandLine}
}
Update-TypeData @TypeData

get-process | sort PagedMemorySize64 -desc | select PagedMemorySize64, ProcessName, CommandLine > processes.txt

get-process | measure-object -sum PagedMemorySize64

PS: hint to use PagedMemorySize64 I took from here: https://stackoverflow.com/questions/46823670/commit-size-of-a-process-in-task-manager-c-sharp

You must log in to answer this question.

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