Is there a command to find out the available memory in Windows?

I am looking for a command that returns the available physical memory in Windows. I tried "systeminfo" but it takes too long and returns a lot of unnessesary information for me. If there is not any command for this what would be the best way to obtain it in a different way using command prompt?


Solution 1:

It takes some time (around 10 seconds for me) but the following command will do it:

systeminfo |find "Available Physical Memory"

Solution 2:

This will do it without taking 10 secs. Try this:

For Total Physical Memory

wmic ComputerSystem get TotalPhysicalMemory

For Available Physical Memory:

wmic OS get FreePhysicalMemory

Solution 3:

Well if you are on Windows 7, you can use this at the powershell prompt:

(Get-WMIObject Win32_PhysicalMemory |  Measure-Object Capacity -Sum).sum

Or if you want a nice pretty how many gigs is it:

(Get-WMIObject Win32_PhysicalMemory |  Measure-Object Capacity -Sum).sum/1GB

Or if you are on an older version of windows (or W7 for that matter) at the command prompt:

wmic memorychip get capacity

Solution 4:

How about

typeperf "\Memory\Available Bytes"

in cmd or powershell prompt? You can find other monitoring instances with the command

typeperf -qx "\Memory"