package mem_usage
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
md5=6c5036811ec7240f659dcd8f764cf382
sha512=98062df94ad6df4c6d6925b26105d83064af658498545fc39d573e9b6441be03c29731bad55ab5aeeab26924520a7378803685f590d2cab359e1a72c282d1193
Description
Added to opam-repository:
README
ocaml-mem_usage
A cross-platform OCaml module for reporting memory usage, with a focus on distinguishing private memory (allocated by the process itself) from shared memory (e.g., shared libraries, memory-mapped files).
Overview
The module reports both system-wide and per-process memory statistics:
Field | Description |
|---|---|
| Total RAM installed on the system |
| Total virtual memory (RAM + swap) |
| RAM currently in use system-wide |
| Virtual memory in use system-wide |
| Virtual address space of the process |
| Resident set size (RSS) - pages in RAM |
| Private pages unique to this process (USS) |
| Process pages swapped to disk |
The key metric is process_private_memory which represents memory that would be freed if this process terminates, excluding shared libraries and other shared mappings.
Supported Platforms
- Linux
- macOS
- Windows
- FreeBSD
Example
let () =
let info = Mem_usage.info () in
Printf.printf "Process private memory: %s\n"
(Mem_usage.prettify_bytes ~binary:true info.process_private_memory)Output:
Process private memory: 1.25 MiBInstallation
opam install mem_usageTo install from source:
git clone https://github.com/savonet/ocaml-mem_usage.git
cd ocaml-mem_usage
opam install .Documentation
License
MIT
Dependencies (3)
-
dune
>= "3.23" -
ocaml
>= "4.08" -
conf-sysinfo
os = "freebsd"
Dev Dependencies (1)
-
odoc
with-doc
Optional Dependencies
None
Used by (2)
-
liquidsoap
>= "2.3.3" -
liquidsoap-core
>= "2.3.0"
Conflicts
None
Build status
Results of building mem_usage 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.0 (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