package memtrace

All checked builds pass
  1. Overview
  2. Docs

Description

Generates compact traces of a program's memory use.

Added to opam-repository:

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"
  2. dune >= "2.3"

Dev Dependencies

None

Optional Dependencies

None

Used by (4)

  1. cascade < "1.1.0"
  2. fstar >= "2025.02.17"
  3. memtrace_viewer >= "v0.15.0"
  4. wire

Conflicts

None

Build status

Results of building memtrace with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.2.3 (this version) good good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure