eventlog2html is a tool for creating interactive visualisations of eventlogs. In particular, it creates interactive charts from the heap profiling events.

The default view is a stacked area chart which shows the cumulative memory usage of a program over time with a band for each type of allocation. This is similar to the chart produced by hp2ps and hp2pretty.

This chart is interactive. An area can be selected on the viewfinder, the selection can be scrolled and zoomed. The legend is interactive, click on the toggles to select individual bands to display and shift-click to select multiple bands to display at once.

How to use

eventlog2html is released on hackage and can be installed like any normal Haskell executable.






Adding markers

An advantage of using the eventlog is that other events can be correlated with heap allocations. Strings emitted using traceEvent are displayed on the chart as a verticle gray line. Hovering near the line will display the name of the event which is nearest to the cursor.

Normalised Line Chart

The normalised line chart is useful for finding out what is increasing in memory throughout the profiling run. Each line represents one type of allocation and the values are normalised against the maximum allocation value for that type. A monotonically increasing line means an increasing amount of memory is being used. A constant line means a constant amount of memory is being used. This information can be hard to see in the stacked charts.


What about biographical and retainer profiling?

The eventlog doesn’t support these two profiling modes yet.

eventlog2html can still read the old .hp file format. Pass the --heap-profile flag to interpret the argument as as .hp file rather than an eventlog.

What if I want to do my own analysis on the heap profile?

eventlog2html can output JSON if you pass the --json flag. The information is a list of rows. One entry for each heap profiling event. Remember to pass --bands 0 if you want the whole data rather than just the 15 top allocators.

Why are the html files so big?

We bundle all the javascript dependencies so the heap profiles can be viewed offline. The --no-include-js option will replace the bundled dependencies with links to a CDN if you prefer a smaller file size.


The charts are implemented using the vega-lite library. If there’s a visualisation that you would like to see added or a different type of chart then feel free to open an issue.


The library started as a fork of hp2pretty but the majority of code has been rewritten since then. It was implemented by Matthew Pickering of this parish and David Binder around the time of Zurihac 2019. The project is developed on GitHub.

Complete Options

eventlog2html - generate interactive html from eventlogs

Available options:
  --sort FIELD             How to sort the bands. One of: size (default),
                           stddev, name.
  --reverse                Reverse the order of bands.
  --trace PERCENT          Percentage of trace elements to
                           combine. (default: 1.0)
  --bands COUNT            Maximum number of bands to draw (0 for
                           unlimited). (default: 15)
  -p,--heap-profile        Input files are .hp heap profiles.
  --no-include-js          Fetch the javascript from a CDN rather than bundling
                           it into the file.
  -j,--json                Output JSON
  --no-traces              Don't display traces on chart
  --colour-scheme ARG      The name of the colour scheme. See the vega
                           for a complete list. Examples include "category10"
                           "dark2" "tableau10".
  -o OUTFILE               Write the output to the given filename.
  FILES...                 Eventlogs (FILE.eventlog will be converted to
  -h,--help                Show this help text