Determining the cause of a serious page error

I was asked to look at an internal application written in C ++ and work on Linux, which has some difficulties. Periodically, it will have a large number of serious page failures (~ 200 thousand), which leads to an increase in the operating time of the wall clock by x10 +, and then it will not have on some runs.

I tried to isolate different parts of the code, but I try my best to repeat the errors of the page error when testing it.

Does anyone have any suggestions for getting more information from a / Linux application for basic page errors? All that I really have is the result.

+4
source share
1 answer

You may like Valgrid described on the home page as:

Valgrind is a tool environment for creating dynamic analysis tools. There are Valgrind tools that can automatically detect many memory and thread management errors, and work out your programs in detail. You can also use Valgrind to create new tools.

In particular, Valgrind contains a tool called Massif , for which the following (rephrased) overview is provided 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 gives the following advantages:

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

  • If your program uses a lot of memory, this will reduce the likelihood that it will run out of space for machine sharing.

+3
source

All Articles