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
- Available fields for process are here
https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process?view=net-6.0 - For StartInfo https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.startinfo?view=net-6.0#system-diagnostics-process-startinfo
- To show only top 10 proccesses, add
-first 10
command parameter
PS: hint to use PagedMemorySize64
I took from here: https://stackoverflow.com/questions/46823670/commit-size-of-a-process-in-task-manager-c-sharp