valgrind --tool=massif ./massif_example
# ==17512== Massif, a heap profiler
# ==17512== Copyright (C) 2003-2017, and GNU GPL'd, by Nicholas Nethercote
# ==17512== Using Valgrind-3.16.0 and LibVEX; rerun with -h for copyright info
# ==17512== Command: ./massif_example
# ==17512==
# ==17512==

# The suffix for the massif output file is the process id that can be found
# to the left of the massif terminal output.
ms_print massif.out.17512 > massif_example.c.annotated
# --------------------------------------------------------------------------------
# Command:            ./massif_example
# Massif arguments:   (none)
# ms_print arguments: massif.out.17512
# --------------------------------------------------------------------------------
# 
# 
#     MB
# 305.2^::::::#::::::::::::::::::::::::::@@@@@@@:::::::::::::::::::::::::::     
#      |:     #      :      :     :      @      :      :     :      :           
#      |:     #      :      :     :      @      :      :     :      :           
#      |:     #      :      :     :      @      :      :     :      :           
#      |:     #      :      :     :      @      :      :     :      :           
#      |:     #      :      :     :      @      :      :     :      :      :::: 
#      |:     #      :      :     :      @      :      :     :      :      :    
#      |:     #      :      :     :      @      :      :     :      :      :    
#      |:     #      :      :     :      @      :      :     :      :      :    
#      |:     #      :      :     :      @      :      :     :      :      :    
#      |:     #      :      :     :      @      :      :     :      :      :   @
#      |:     #      :      :     :      @      :      :     :      :      :   @
#      |:     #      :      :     :      @      :      :     :      :      :   @
#      |:     #      :      :     :      @      :      :     :      :      :   @
#      |:     #      :      :     :      @      :      :     :      :      :   @
#      |:     #      :      :     :      @      :      :     :      :      :   @
#      |:     #      :      :     :      @      :      :     :      :      :   @
#      |:     #      :      :     :      @      :      :     :      :      :   @
#      |:     #      :      :     :      @      :      :     :      :      :   @
#      |:     #      :      :     :      @      :      :     :      :      :   @
#    0 +----------------------------------------------------------------------->Mi
#      0                                                                   715.4
# 
# Number of snapshots: 28
#  Detailed snapshots: [5 (peak), 15, 25]
# 
# --------------------------------------------------------------------------------
#   n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
# --------------------------------------------------------------------------------
#   0              0                0                0             0            0
#   1        153,593       80,003,016       80,000,000         3,016            0
#   2        153,627      160,006,032      160,000,000         6,032            0
#   3        153,661      240,009,048      240,000,000         9,048            0
#   4        153,695      320,012,064      320,000,000        12,064            0
#   5     70,154,377      320,012,064      320,000,000        12,064            0
# 100.00% (320,000,000B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
# ->25.00% (80,000,000B) 0x401068: main (massif_example.c:14)
# | 
# ->25.00% (80,000,000B) 0x401075: main (massif_example.c:15)
# | 
# ->25.00% (80,000,000B) 0x401082: main (massif_example.c:17)
# | 
# ->25.00% (80,000,000B) 0x40108F: main (massif_example.c:20)
#   
# --------------------------------------------------------------------------------
#   n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
# --------------------------------------------------------------------------------
#   6     70,154,377      240,009,048      240,000,000         9,048            0
#   7     70,154,409      320,012,064      320,000,000        12,064            0
#   8    140,154,444      240,009,048      240,000,000         9,048            0
#   9    140,154,476      320,012,064      320,000,000        12,064            0
#  10    210,154,511      240,009,048      240,000,000         9,048            0
#  11    210,154,543      320,012,064      320,000,000        12,064            0
#  12    280,154,578      240,009,048      240,000,000         9,048            0
#  13    280,154,610      320,012,064      320,000,000        12,064            0
#  14    350,154,645      240,009,048      240,000,000         9,048            0
#  15    350,154,677      320,012,064      320,000,000        12,064            0
# 100.00% (320,000,000B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
# ->25.00% (80,000,000B) 0x401068: main (massif_example.c:14)
# | 
# ->25.00% (80,000,000B) 0x401075: main (massif_example.c:15)
# | 
# ->25.00% (80,000,000B) 0x401082: main (massif_example.c:17)
# | 
# ->25.00% (80,000,000B) 0x40108F: main (massif_example.c:20)
#   
# --------------------------------------------------------------------------------
#   n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
# --------------------------------------------------------------------------------
#  16    420,154,712      240,009,048      240,000,000         9,048            0
#  17    420,154,744      320,012,064      320,000,000        12,064            0
#  18    490,154,779      240,009,048      240,000,000         9,048            0
#  19    490,154,811      320,012,064      320,000,000        12,064            0
#  20    560,154,846      240,009,048      240,000,000         9,048            0
#  21    560,154,878      320,012,064      320,000,000        12,064            0
#  22    630,154,913      240,009,048      240,000,000         9,048            0
#  23    630,154,945      320,012,064      320,000,000        12,064            0
#  24    700,154,980      240,009,048      240,000,000         9,048            0
#  25    750,155,015      160,006,032      160,000,000         6,032            0
# 100.00% (160,000,000B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
# ->50.00% (80,000,000B) 0x401075: main (massif_example.c:15)
# | 
# ->50.00% (80,000,000B) 0x401082: main (massif_example.c:17)
# | 
# ->00.00% (0B) in 1+ places, all below ms_print's threshold (01.00%)
# 
# --------------------------------------------------------------------------------
#   n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
# --------------------------------------------------------------------------------
#  26    750,155,045       80,003,016       80,000,000         3,016            0
#  27    750,155,075                0                0             0            0
