AWS:如何在Windows中获取可用内存

时间:2021-12-21 17:00:01

On other machines, I have used the PowerShell cmdlet Get-CimInstance to get the total physical memory available:

在其他机器上,我使用了PowerShell cmdlet Get-CimInstance来获取可用的总物理内存:

(Get-CimInstance -class 'cim_physicalmemory') |
    Measure -Property capacity -Sum

But Get-CimInstance -class 'cim_physicalmemory' returns nothing on EC2.

但是Get-CimInstance -class'cim_physicalmemory'在EC2上没有返回任何内容。

Is there another CIM alternative to the CIM_PhysicalMemory class for calculating the total amount of RAM available on the system?

是否有另一种CIM替代CIM_PhysicalMemory类来计算系统上可用的RAM总量?

1 个解决方案

#1


0  

It seems like the CIM_ComputerSystem class contains the TotalPhysicalMemory property, which is approximately what I want. On a physical machine, the two don't have the same exact value, but they are close enough.

看起来CIM_ComputerSystem类包含TotalPhysicalMemory属性,这大概就是我想要的。在物理机器上,两者没有相同的确切值,但它们足够接近。

#1


0  

It seems like the CIM_ComputerSystem class contains the TotalPhysicalMemory property, which is approximately what I want. On a physical machine, the two don't have the same exact value, but they are close enough.

看起来CIM_ComputerSystem类包含TotalPhysicalMemory属性,这大概就是我想要的。在物理机器上,两者没有相同的确切值,但它们足够接近。