识别主要页面错误原因

发布于 2024-10-04 00:43:30 字数 217 浏览 1 评论 0原文

我被要求查看一个用 C++ 编写并在 Linux 上运行的内部应用程序,该应用程序遇到了一些困难。 它会定期出现大量主要页面错误(~200k),这会导致挂钟运行时间增加 10+,然后在某些运行中它不会出现任何错误。

我尝试过隔离不同的代码片段,但在测试时很难重复页面错误错误。

对于从应用程序/Linux 中获取有关主要页面错误的更多信息,有人有任何建议吗?我所拥有的实际上只是一个总数。

I've been asked to look at an internal application written in C++ and running on Linux thats having some difficulties.
Periodically it will have a large amount of major page faults (~200k), which cause the wall clock run time to increase by x10+, then on some runs it will have none.

I've tried isolating different pieces of the code but am struggling to repeat the page fault errors when testing it.

Does anyone have any suggestions for getting any more information out of the application/Linux on major page faults? All I have really is a total.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

栩栩如生 2024-10-11 00:43:30

您可能会考虑Valgrid,其主页上的描述如下:

Valgrind 是一个用于构建动态分析工具的仪器框架。 Valgrind 工具可以自动检测许多内存管理和线程错误,并详细分析您的程序。您还可以使用 Valgrind 构建新工具。

具体来说,Valgrind 包含一个名为 Massif 的工具,以下(转述)概述手册中给出:

Massif 是一个堆分析器。它测量您的程序使用了多少堆内存。 [..]

堆分析可以帮助您减少程序使用的内存量。在具有虚拟内存的现代计算机上,这提供了以下好处:

  • 它可以加速您的程序 - 较小的程序将更好地与您的计算机缓存交互并避免分页。

  • 如果您的程序使用大量内存,则会减少耗尽计算机交换空间的可能性。

You may like to consider Valgrid, described on the home page as:

Valgrind is an instrumentation framework for building dynamic analysis tools. There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail. You can also use Valgrind to build new tools.

Specifically Valgrind contains a tool called Massif, for which the following (paraphrased) overview is given in the manual:

Massif is a heap profiler. It measures how much heap memory your program uses. [..]

Heap profiling can help you reduce the amount of memory your program uses. On modern machines with virtual memory, this provides the following benefits:

  • It can speed up your program -- a smaller program will interact better with your machine's caches and avoid paging.

  • If your program uses lots of memory, it will reduce the chance that it exhausts your machine's swap space.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文