{"id":28615670,"url":"https://github.com/ocamlpro/memthol","last_synced_at":"2025-06-12T02:09:40.003Z","repository":{"id":56141708,"uuid":"313953854","full_name":"OCamlPro/memthol","owner":"OCamlPro","description":"Memthol is a visualizer for memory profiling data generated from OCaml programs.","archived":false,"fork":false,"pushed_at":"2022-11-17T13:53:08.000Z","size":22544,"stargazers_count":27,"open_issues_count":1,"forks_count":3,"subscribers_count":8,"default_branch":"master","last_synced_at":"2023-08-23T20:47:27.267Z","etag":null,"topics":["ocaml","profiling","rust","visualization"],"latest_commit_sha":null,"homepage":"https://ocamlpro.github.io/memthol/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OCamlPro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-18T14:07:20.000Z","updated_at":"2022-12-09T09:32:40.000Z","dependencies_parsed_at":"2022-08-15T13:30:55.598Z","dependency_job_id":null,"html_url":"https://github.com/OCamlPro/memthol","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"purl":"pkg:github/OCamlPro/memthol","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fmemthol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fmemthol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fmemthol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fmemthol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OCamlPro","download_url":"https://codeload.github.com/OCamlPro/memthol/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fmemthol/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259382357,"owners_count":22848845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ocaml","profiling","rust","visualization"],"created_at":"2025-06-12T02:09:36.939Z","updated_at":"2025-06-12T02:09:39.988Z","avatar_url":"https://github.com/OCamlPro.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Memthol is a visualizer for memory profiling data generated from [OCaml] programs.\n\n\n# Resources\n\n- [Official page][memthol] \n- [API documentation][doc]\n- [Memthol's small tutorial][tuto]\n\n\n# Features\n\n- [x] multi-client: open several tabs in your browser for the same profiling session to visualize\n    the data separately\n- [x] self-contained: the BUI packs all its static assets, once you have the binary you do not need\n    anything else (except a browser)\n- [x] data-splitting: plot several families of data separately in the same chart by separating them\n    based on size, allocation lifetime, source locations in the allocation callstack, *etc.*\n- [ ] multiple metrics to plot different kinds of data: allocation lifetime, size, time of creation,\n    *etc.*\n- [ ] flamegraphs\n\n\n# What It Looks Like\n\n![](rsc/example.png)\n\n\n# Browser Compatibility\n\nMemthol is mostly tested on the Chrome web browser. You might experience problems with other\nbrowser, in which case we recommend you open an [issue][memthol issues].\n\n\n# Dump Files\n\nMemthol's current official input format is memory dumps produced by [*Memtrace*][memtrace] ([on\ngithub][memtrace git]). A memtrace dump for a program execution is a single [**C**ommon **T**race\n**F**ormat](https://diamon.org/ctf) (CTF) file.\n\nNote that this repository contains a minimal Memtrace example in [`rsc/memtrace_example`][memtrace\nexample].\n\n\n# Build\n\n## Pre-requisites\n\nSince memthol's UI is browser-based, it has a client written in [Rust] that compiles to [web\nassembly] (wasm). To do this, you need to have the [rust toolchain].\n\n- add the wasm target for rustup:\n\n    ```bash\n    rustup target add wasm32-unknown-unknown\n    ```\n\n- make sure everything is up to date with\n\n    ```bash\n    rustup update\n    ```\n\n- make sure you have [wasm-pack] installed so that Rust can compile the client\n\n    installation instructions [here][install wasm-pack], although `cargo install wasm-pack` should\n    work\n\n- install [`cargo-make`][cargo make] with `cargo install cargo-make`\n\nMemthol UI's dependencies rely on some OS-level packages. Please make sure they are installed and in\nyour path:\n\n- build essentials (including `cmake`)\n- openssl/libssl\n- freetype\n- expat\n\n## `debug`\n\n\u003e **NB**: memthol is quite slow in `debug` mode. If you have a lot of data to process, definitely\n\u003e build in release instead.\n\nTo build memthol in `debug` mode, run\n\n```bash\ncargo make build\n```\n\nThe memthol binary will be in `target/debug/memthol`\n\n### `release`\n\nTo build memthol in `release` mode, run\n\n```bash\ncargo make release\n```\n\nThe memthol binary will be in `./memthol_ui`, also available as `target/release/memthol`.\n\n# Testing\n\nRun memthol-ui on the test files located on this repository, in `rsc/ctf/mini_ae.ctf` to make sure\nit works. Assuming your binary is called `memthol` and is in you path, and you are at the root of\nthis repository:\n\n```bash\nmemthol rsc/dumps/ctf/mini_ae.ctf\n```\n\nThere is a bigger set of data you can use for testing, although we recommend you build in `release`\nmode for this one:\n\n```bash\nmemthol rsc/dumps/ctf/flambda.ctf\n```\n\n# Icons\n\nMost icons used in memthol come from the [bootstrap library][bootstrap].\n\n[memthol]: https://ocamlpro.github.io/memthol/ (Memthol site)\n[doc]: https://ocamlpro.github.io/memthol/doc/memthol (Documentation site)\n[OCaml]: https://ocaml.org/ (OCaml official page)\n[web assembly]: https://webassembly.org/ (Web Assembly official page)\n[Rust]: https://www.rust-lang.org/ (Rust official page)\n[rust toolchain]: https://www.rust-lang.org/tools/install (Rust installation instructions)\n[wasm-pack]: https://crates.io/crates/cargo-web (Cargo-web on crates.io)\n[tuto]: https://ocamlpro.github.io/memthol/mini_tutorial/ (Memthol's tutorial on github pages)\n[install wasm-pack]: https://rustwasm.github.io/wasm-pack/installer (wasm-pack install instructions)\n[bootstrap]: https://icons.getbootstrap.com (the bootstrap library)\n[cargo make]: https://crates.io/crates/cargo-make (cargo-make on crates.io)\n[memtrace]: https://blog.janestreet.com/finding-memory-leaks-with-memtrace\n(Blog post: Finding Memory Leaks With Memtrace)\n[memtrace git]: https://github.com/janestreet/memtrace\n(Memtrace on github.com)\n[memtrace example]: ./rsc/memtrace_example\n[memthol repo]: https://github.com/OCamlPro/memthol (Memthol github repository)\n[memthol issues]: https://github.com/OCamlPro/memthol/issues\n(Issues on the Memthol github repository)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focamlpro%2Fmemthol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focamlpro%2Fmemthol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focamlpro%2Fmemthol/lists"}