package memtrace

  1. Overview
  2. Docs
Streaming client for Memprof

Install

Dune Dependency

Authors

Maintainers

Sources

memtrace-v0.2.1.2.tbz
sha256=c86f09e79d48bcd0852ab94b11766408c3a10d77df7640b88841271d5bfa5932
sha512=d9465d1bcbd5d35e66456c0b1b37b4efd097696aaac1b8fc8472ad477d96ef982551d73d72b98213d266013f40528ed6e7834e22d66d6edd321bccc1b8c08051

Description

Generates compact traces of a program's memory use.

Published: 11 Mar 2021

README

memtrace

A streaming client for OCaml's Memprof, which generates compact traces of a program's memory use.

To profile the memory use of a program, start by putting this line somewhere at the program startup:

Memtrace.trace_if_requested ~context:"my program" ();;

If the MEMTRACE environment variable is present, tracing begins to the filename it specifies. (If it's absent, nothing happens)

The ~context parameter is optional, and can be set to any string that helps to identify the trace file.

If the program daemonises, the call to trace_if_requested should occur after the program forks, to ensure the right process is traced.

The resulting trace files can be analysed with some simple command-line tools in bin/, but the recommended interface is the memtrace viewer, which lives at:

https://github.com/janestreet/memtrace_viewer

Dependencies (2)

  1. ocaml >= "4.11.0" & < "5.0"
  2. dune >= "2.3"

Dev Dependencies

None

Used by (2)

  1. irmin-bench < "3.3.0"
  2. memtrace_viewer >= "v0.15.0"

Conflicts

None

OCaml

Innovation. Community. Security.