How can I get total physical memory using Windows

2019-03-13 07:40发布

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..

3条回答
forever°为你锁心
2楼-- · 2019-03-13 08:05

Try this

wmic memorychip get capacity
查看更多
ら.Afraid
3楼-- · 2019-03-13 08:09

Viktar's answer (wmic memorychip get capacity) gives you the capacity of each Dimm (which will work fine, if you have only one Dimm installed but gives you one value per Dimm if there is installed more than one). To get the size of total memory use:

wmic computersystem get TotalPhysicalMemory
查看更多
We Are One
4楼-- · 2019-03-13 08:20

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

查看更多
登录 后发表回答