Massif: a heap profiler
KB
19.63^
#
|
#
|
#
|
#
|
#
|
#
|
#
|
#
|
#
|
#
|
#
|
#
|
#
|
#
|
#
|
#
|
#
|
:#
|
:#
|
:#
0 +----------------------------------------------------------------------->ki
0
113.4
Number of snapshots: 25
Detailed snapshots: [9, 14 (peak), 24]
Why is most of the graph empty, with only a couple of bars at the very end?
By default, Massif uses "instructions
executed" as the unit of time. For very short-run programs such as the example, most of the executed instructions
involve the loading and dynamic linking of the program. The execution of
main
(and thus the heap allocations) only
occur at the very end. For a short-running program like this, we can use the
--time-unit=B
option to specify that
we want the time unit to instead be the number of bytes allocated/deallocated on the heap and stack(s).
If we re-run the program under Massif with this option, and then re-run ms_print, we get this more useful graph:
139
Содержание BBV
Страница 176: ...Valgrind FAQ Release 3 8 0 10 August 2012 Copyright 2000 2012 Valgrind Developers Email valgrind valgrind org ...
Страница 177: ...Valgrind FAQ Table of Contents Valgrind Frequently Asked Questions 1 ii ...
Страница 302: ...README mips based on newer GCC versions if possible 95 ...
Страница 303: ...GNU Licenses ...
Страница 304: ...GNU Licenses Table of Contents 1 The GNU General Public License 1 2 The GNU Free Documentation License 8 ii ...