如何询问有关RAM是在单通道,双通道还是四通道运行的窗口?

Joh*_*nAl 15 language-agnostic windows ram wmi

如何检测当前的RAM配置?我需要向windows询问RAM当前是在单通道,双通道还是四通道运行.

我搜索了很多,并没有在这个或其他网站上发现任何类似的问题,这对我来说非常令人惊讶.

我正在使用C++,但这个问题确实适用于所有编程语言,因为它是关于什么是windows函数或powershell/ cmd命令将给我我需要的信息.

Dyl*_*ore 5

InterleavePosition是您要找的东西。一个出现是2,2,2因为它在双通道中运行了3个摇杆。您需要找出的是如何识别运行单通道的计算机,以便可以使用以下命令的输出:

wmic memorychip get InterleavePosition
Run Code Online (Sandbox Code Playgroud)

编辑:实际上不确定3支双通道。一些研究表明,当今大多数主板将使单通道成为单通道。

因此,在MSDN中,这是我们在挖掘有关交错内存的系统信息时必须使用的方法。

Position of the physical memory in an interleave. For example, in a 2:1 interleave, a value of "1" indicates that the memory is in the "even" position.

This property is inherited from CIM_PhysicalMemory.

0 - Noninterleaved

1 - First position

2 - Second position
Run Code Online (Sandbox Code Playgroud)

加上InterleaveDataDepth这说:

InterleaveDataDepth

Unsigned 16-bit integer maximum number of consecutive rows of data that are accessed in a single interleaved transfer from the memory device. If the value is 0 (zero), the memory is not interleaved.
Run Code Online (Sandbox Code Playgroud)

请注意,交错是“相互共享”的一个奇特词,与当今的多渠道类似,但不是同一回事。从交错存储器上的Wiki:

它与多通道内存体系结构不同,主要是因为交错式内存不会在主内存和内存控制器之间添加更多通道。但是,也可以进行频道交织... []

使用此命令,我将分享使用cmd.exe在双通道中具有4个RAM棒的外观:

wmic输出双通道内存的示例

编辑:几个人已经确认这些值在某些机器上可以正常工作,但是经常返回令人困惑的/无意义的值。

  • @JohnAl:CPU-Z只是“询问Windows”并不是真的。当然,它使用Windows API来获取数据,但是它可能正在获取原始二进制固件表,然后解释内容本身。因此,可能没有任何Windows API可以执行此解释。 (3认同)