Inspects OCaml heap values and lowers the reachable object graph to graphviz DOT
  • OCaml 98.3%
  • Dune 1.7%
Find a file
2026-07-07 17:27:13 +00:00
.github/workflows Initial 2026-07-07 17:27:13 +00:00
bench Initial 2026-07-07 17:27:13 +00:00
docs Initial 2026-07-07 17:27:13 +00:00
examples Initial 2026-07-07 17:27:13 +00:00
src Initial 2026-07-07 17:27:13 +00:00
test Initial 2026-07-07 17:27:13 +00:00
.gitignore Initial 2026-07-07 17:27:13 +00:00
.ocamlformat Initial 2026-07-07 17:27:13 +00:00
dune Initial 2026-07-07 17:27:13 +00:00
dune-project Initial 2026-07-07 17:27:13 +00:00
graphis.opam Initial 2026-07-07 17:27:13 +00:00
README.md Initial 2026-07-07 17:27:13 +00:00

graphis

Inspects OCaml heap values and lowers the reachable object graph to Graphviz DOT

graphis heap graph

API

The capture context is the alias analysis boundary. Values captured through the same context share one address table so repeated physical values lower to the same node and cycles terminate through the visited set

Graphis.context (fun ctx ->
  let shared = [| "left"; "right" |] in
  let root = shared, shared in
  Graphis.print_dot Format.std_formatter
    [ "root", Graphis.capture ctx root ])

The same graph can be written as DOT for Graphviz

Graphis.context (fun ctx ->
  let shared = [| "left"; "right" |] in
  let root = shared, shared in
  Graphis.write_dot "heap.dot"
    [ "root", Graphis.capture ctx root ])