Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get total physical memory using Windows cmd

I inquired typeperf counters and instances, but couldn't find anything about the total memory. I only found

    \Memory\Availble Bytes
    \Memory\Cache Bytes
    \Process\Private Bytes
    \Process\Working Set

and adding any combination of them didn't match the total memory in task manager.

I also tried

    systeminfo | findstr /C:"Total Physical Memory"

but this only worked in english mode(chcp 437). I am not an American and making program for various countries.. and above all, this takes too long time.

Please, anyone know good idea to get total memory in Windows with only cmd? Or please explain me the relation of memories so that I can calculate the total memory from typeperf queries..

like image 862
rumicube Avatar asked Mar 25 '15 07:03

rumicube


People also ask

How do I check my total physical memory?

Here's how: Press Ctrl + Shift + Esc to launch Task Manager. Or, right-click the Taskbar and select Task Manager. Select the Performance tab to see current RAM usage displayed in the Memory box, and total RAM capacity listed under Physical Memory.

Which command displays amount of total memory?

vmstat Command to Report Virtual Memory Statistics. The vmstat command is a useful tool that reports virtual memory statistics. vmstat provides general information about processes, memory, paging, block IO, traps, and CPU activity.

How much physical memory is installed?

Press the Windows key , type Properties, and then press Enter . In the System Properties window, the Installed memory (RAM) entry displays the total amount of RAM installed in the computer. For example, in the picture below, there is 4 GB of memory installed in the computer.

How do I check my physical memory on Windows server?

Right-click on Start menu button and then click on Task Manager . Click on Performance tab and then on Memory option. The Memory option shows details such as Total memory, used memory and available memory. This option also shows two graphs related to the Memory in the server.


1 Answers

How can I get total physical memory

Use the following command:

wmic ComputerSystem get TotalPhysicalMemory

Example output:

TotalPhysicalMemory
4275273728

Total Physical Memory

wmic ComputerSystem get TotalPhysicalMemory

Available Physical Memory

wmic OS get FreePhysicalMemory

Virtual Memory Max Size

wmic OS get TotalVirtualMemorySize

Virtual Memory Available

wmic OS get FreeVirtualMemory

You can combine them as follows into one command:

wmic ComputerSystem get TotalPhysicalMemory && wmic OS get FreePhysicalMemory,TotalVirtualMemorySize,FreeVirtualMemory

Source SuperUser answer What's the equivalent command of “wmic memlogical” in Windows 7? by 8088

like image 169
DavidPostill Avatar answered Sep 19 '22 18:09

DavidPostill