The msparser module offers a simple interface to parse the Valgrind massif.out
file format, i.e. data files produced by the valgrind heap profiler and should be
compatible with Python 2.5 and up (including 3.x and pypy).

How do I use it?

Import the module

As usual, import the module:

>>> import msparser

Parse a massif.out file

To extract the data from a massif.out file, you simply have to give its path to
the parse_file function:

>>> data = msparser.parse_file('massif.out')

You could also use the msparser.parse function directly with a file
descriptor.

Understand the data

The parsed data is returned as a dictionary which follow closely the massif.out
format. It looks like this:

The detailed_snapshots_index and peak_snapshot_index fields allow
efficient localisation of the detailled and peak snapshots in the snapshots
list. For example, to retrieve the peak snapshot from the snapshots list,
we could do: