Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I use </p> <pre><code>valgrind --tool=massif ./myprogram -opt arg1 arg2 ms_print massif.* | less -SR </code></pre> <p>for that. Sample output from <a href="http://valgrind.org/docs/manual/ms-manual.html" rel="nofollow">this page</a></p> <pre><code>19.63^ ### | # | # :: | # : ::: | :::::::::# : : :: | : # : : : :: | : # : : : : ::: | : # : : : : : :: | ::::::::::: # : : : : : : ::: | : : # : : : : : : : :: | ::::: : # : : : : : : : : :: | @@@: : : # : : : : : : : : : @ | ::@ : : : # : : : : : : : : : @ | :::: @ : : : # : : : : : : : : : @ | ::: : @ : : : # : : : : : : : : : @ | ::: : : @ : : : # : : : : : : : : : @ | :::: : : : @ : : : # : : : : : : : : : @ | ::: : : : : @ : : : # : : : : : : : : : @ | :::: : : : : : @ : : : # : : : : : : : : : @ | ::: : : : : : : @ : : : # : : : : : : : : : @ 0 +-----------------------------------------------------------------------&gt;KB 0 29.48 Number of snapshots: 25 Detailed snapshots: [9, 14 (peak), 24] </code></pre> <p>The remainder of the log details the highest percentiles of memory allocations, you can specifically see what type of class takes what % of heap memory (and where the allocations originate in terms of call stack), e.g.:</p> <pre><code>-------------------------------------------------------------------------------- n time(B) total(B) useful-heap(B) extra-heap(B) stacks(B) -------------------------------------------------------------------------------- 10 10,080 10,080 10,000 80 0 11 12,088 12,088 12,000 88 0 12 16,096 16,096 16,000 96 0 13 20,104 20,104 20,000 104 0 14 20,104 20,104 20,000 104 0 99.48% (20,000B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc. -&gt;49.74% (10,000B) 0x804841A: main (example.c:20) | -&gt;39.79% (8,000B) 0x80483C2: g (example.c:5) | -&gt;19.90% (4,000B) 0x80483E2: f (example.c:11) | | -&gt;19.90% (4,000B) 0x8048431: main (example.c:23) | | | -&gt;19.90% (4,000B) 0x8048436: main (example.c:25) | -&gt;09.95% (2,000B) 0x80483DA: f (example.c:10) -&gt;09.95% (2,000B) 0x8048431: main (example.c:23) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload