≡ Menu

Find memory size

In Windows, we can find the physical memory size from command line. We can do this either using systeminfo or wmic commands. Both the commands are given below.

1. Using systeminfo command

systeminfo | findstr /C:"Total Physical Memory"

Example:

C:\>systeminfo | findstr /C:"Total Physical Memory"
Total Physical Memory:     3,794 MB

2. Using WMIC command

wmic memorychip list full

This command gives the size in bytes.
Example:

C:\>wmic memorychip get capacity
Capacity
4294967296

The example commands are run on the same computer. As you might have noticed, the value showed by systeminfo command is less than what wmic command shows.
This discrepancy can be understood as follows. Wmic command shows the total installed memory on the system where as systeminfo command shows usable memory(which is total mermory – hardware reserved memory). For more information, check this out  http://support.microsoft.com/kb/978610

12 comments… add one
  • lenora

    My pc is windows 7 ultimate 32-bit.How can i increase my ram size from 1GB to 2.5GB using cmd?i tried to change i t using advanced system settings but when i restarted it showed 1 GB.I tried many other ways like patching but it was of no use.Can u send me any possible way to increase my ram size by patching from the space from other drives.?i would be thankful if i get a solution as soon as possible.

    • Montor

      Your ram size is determined by the amount of ram built into your pc. Other than opening your pc case, buying bigger ones and inserting them into the pc’s ram sockets you will not be able to increase the size.

  • Jagadeesh

    Hi, I would like to find out “Free RAM Space” without using ‘systeminfo’ command. Could u pls help me.

  • nikesh

    Thanks..for this information..it also gives information @ ram frequency

  • cottonvibes

    The wmic command in your article doesn’t give the total amount of physical memory, it only gives the capacity for 1 memory module. On this PC I have 2 4gb RAM modules, and “wmic memorychip get capacity” returns “4294967296” (ie 4gb)

    On windows 7 use the following command to get the total physical memory in bytes:
    wmic ComputerSystem get TotalPhysicalMemory
    which for me returns:
    8575811584

    • Jeff

      The command `wmic memorychip get capacity` give the capacity for each chip.

      You can improve the result by using the command line `wmic memorychip get BankLabel,capacity`.

      Your command `wmic ComputerSystem get TotalPhysicalMemory` is also very useful.

  • Jim Clunie

    OK, I can see how to find the physical memsize, but can that value be passed into a variable so I can use it later in a batch file? i.e. get the physical memory then use that number to calculate what appropriate pagefile size…

  • Ed

    While systeminfo | findstr /C:”Total Physical Memory” provides “Total Physical Memory: 3,794 MB”

    How can i get JUST 3794
    parsing Total Physical Memory: , the comma, spaces and MB?

    • ASB

      Ed, here’s what you would need in your shell script to parse the data you are asking for:

      FOR /F “TOKENS=4” %%M IN (‘systeminfo 2^>NUL ^| find “Total Physical Memory” 2^>NUL’) DO SET @MYRAM=%%M
      IF DEFINED @MYRAM SET @MYRAM=%@MYRAM:,=%

      The above are two lines, one starting with FOR and the other starting with IF
      The “2^>NUL” portions of the first line is to hide all non-essential output

  • David

    Hi, I work on win10, and i want fix virtual memorie at 2x the RAM if it ‘s under 8Go of RAM,
    and 1x RAM if it ‘s egal or highter than 8Go of RAM.
    how can i make that?

  • Jackson

    It doesn’t work on my device…”wmic is not recognized as an internal or external command”. Help me please!

    • ASB

      Jackson, what version of Windows (including build numbers) do you have, on what device?

Leave a Comment