DHAT: a dynamic heap analysis tool
max-live:
317,408 in 5,668 blocks
tot-alloc:
317,408 in 5,668 blocks (avg size 56.00)
deaths:
5,668, at avg age 622,890,597
acc-ratios:
1.03 rd, 1.28 wr
(327,642 b-read, 408,172 b-written)
at 0x4C275B8: malloc (vg_replace_malloc.c:236)
by 0x5440C16: QDesignerPropertySheetPrivate::ensureInfo (qhash.h:515)
by 0x544350B: QDesignerPropertySheet::setVisible (qdesigner_propertysh...)
by 0x5446232: QDesignerPropertySheet::QDesignerPropertySheet (qdesigne...)
Aggregated access counts by offset:
[
0]
28782 28782 28782 28782 28782 28782 28782 28782
[
8]
20638 20638 20638 20638 0 0 0 0
[
16]
22738 22738 22738 22738 22738 22738 22738 22738
[
24]
6013 6013 6013 6013 6013 6013 6013 6013
[
32]
18883 18883 18883 37422 0 0 0 0
[
36]
5668 11915 5668 5668 11336 11336 11336 11336
[
48]
6166 6166 6166 6166 0 0 0 0
This is fairly typical, for C++ code running on a 64-bit platform. Here, we have aggregated access statistics for 5668
blocks, all of size 56 bytes. Each byte has been accessed at least 5668 times, except for offsets 12--15, 36--39 and
52--55. These are likely to be alignment holes.
Careful interpretation of the numbers reveals useful information. Groups of N consecutive identical numbers that
begin at an N-aligned offset, for N being 2, 4 or 8, are likely to indicate an N-byte object in the structure at that point.
For example, the first 32 bytes of this object are likely to have the layout
[0 ]
64-bit type
[8 ]
32-bit type
[12]
32-bit alignment hole
[16]
64-bit type
[24]
64-bit type
As a counterexample, it’s also clear that, whatever is at offset 32, it is not a 32-bit value.
That’s because the last
number of the group (37422) is not the same as the first three (18883 18883 18883).
This example leads one to enquire (by reading the source code) whether the zeroes at 12--15 and 52--55 are alignment
holes, and whether 48--51 is indeed a 32-bit type.
If so, it might be possible to place what’s at 48--51 at 12--15
instead, which would reduce the object size from 56 to 48 bytes.
Bear in mind that the above inferences are all only "maybes".
That’s because they are based on dynamic data, not
static analysis of the object layout. For example, the zeroes might not be alignment holes, but rather just parts of the
structure which were not used at all for this particular run.
Experience shows that’s unlikely to be the case, but it
could happen.
10.3. DHAT Command-line Options
DHAT-specific command-line options are:
153