Download Valgrind Documentation
Transcript
DHAT: a dynamic heap analysis tool --show-top-n=<number> [default: 10] At the end of the run, DHAT sorts the accumulated allocation points according to some metric, and shows the highest scoring entries. --show-top-n controls how many entries are shown. The default of 10 is quite small. For realistic applications you will probably need to set it much higher, at least several hundred. --sort-by=<string> [default: max-bytes-live] At the end of the run, DHAT sorts the accumulated allocation points according to some metric, and shows the highest scoring entries. --sort-by selects the metric used for sorting: max-bytes-live maximum live bytes [default] tot-bytes-allocd total allocation (turnover) max-blocks-live maximum live blocks This controls the order in which allocation points are displayed. You can choose to look at allocation points with the highest maximum liveness, or the highest total turnover, or by the highest number of live blocks. These give usefully different pictures of program behaviour. For example, sorting by maximum live blocks tends to show up allocation points creating large numbers of small objects. One important point to note is that each allocation stack counts as a seperate allocation point. Because stacks by default have 12 frames, this tends to spread data out over multiple allocation points. You may want to use the flag --num-callers=4 or some such small number, to reduce the spreading. 130