如何测量 Windows 上的内存带宽利用率?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3386042/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 14:56:57  来源:igfitidea点击:

How to measure memory bandwidth utilization on Windows?

windowsperformanceprofiling

提问by pdeva

I have a highly threaded program but I believe it is not able to scale well across multiple cores because it is already saturating all the memory bandwidth.

我有一个高度线程化的程序,但我相信它无法在多个内核之间很好地扩展,因为它已经使所有内存带宽饱和。

Is there any tool out there which allows to measure how much of the memory bandwidth is being used?

是否有任何工具可以测量正在使用的内存带宽?

Edit: Please note that typical profilers show things like memory leaks and memory allocation, which I am not interested in. I am only whether the memory bandwidth is being saturated or not.

编辑:请注意,典型的分析器会显示诸如内存泄漏和内存分配之类的内容,我对此不感兴趣。我只关心内存带宽是否饱和。

回答by Roman Dementiev

If you have a recent Intel processor, you might try to use Intel(r) Performance Counter Monitor: http://software.intel.com/en-us/articles/intel-performance-counter-monitor/It can directly measure consumed memory bandwidth from the memory controllers.

如果您有最新的 Intel 处理器,您可以尝试使用 Intel(r) Performance Counter Monitor:http: //software.intel.com/en-us/articles/intel-performance-counter-monitor/它可以直接测量消耗来自内存控制器的内存带宽。

回答by Matt

I'd recommend the Visual Studio Sample Profiler which can collect sample events on specific hardware counters. For example, you can choose to sample on cache misses. Here's an article explaining how to choose the CPU counter, though there are other counters you can play with as well.

我建议使用 Visual Studio Sample Profiler,它可以收集特定硬件计数器上的示例事件。例如,您可以选择对缓存未命中进行采样。 这是一篇解释如何选择 CPU 计数器的文章,尽管您也可以使用其他计数器。

回答by computinglife

it would be hard to find a tool that measured memory bandwidth utilization for your application.

很难找到一种工具来测量您的应用程序的内存带宽利用率。

But since the issue you face is a suspected memory bandwidth problem, you could try and measure if your application is generating a lot of page faults / sec, which would definitely mean that you are no where near the theoretical memory bandwidth.

但是由于您面临的问题是可疑的内存带宽问题,您可以尝试测量您的应用程序是否每秒产生大量页面错误,这肯定意味着您离理论内存带宽还很远。

You should also measure how cache friendly your algorithms are. If they are thrashing the cache, your memory bandwidth utilization will be severely hampered. Google "measuring cache misses" on good sources that tells you how to do this.

您还应该衡量您的算法对缓存的友好程度。如果他们正在处理缓存,您的内存带宽利用率将受到严重阻碍。谷歌在告诉您如何执行此操作的良好来源上“测量缓存未命中”。