-
Notifications
You must be signed in to change notification settings - Fork 470
dune build -w memory usage grows without bounds when using OCaml syntax in dune files #6900
Copy link
Copy link
Closed
ocaml/opam-repository
#24013Milestone
Description
Expected Behavior
dune build -w memory usage should stay below some upper bound over a longer period of time.
Actual Behavior
dune build -w grows without bounds.
Reproduction
Minimal example:
% cat test.ml
% cat dune
(* -*- tuareg -*- *)
open StdLabels
open Jbuild_plugin.V1
let () =
Printf.ksprintf send {|
(executable
(libraries stdlib-shims)
(name test))
|}
% cat dune-project
(lang dune 3.0)
% dune build -w test.exe
In another terminal:
while true; do; echo >> test.ml; sleep 0.1; done
More realistic example:
- In any bigger project, run
git clone https://github.com/ocaml/stdlib-shims.git && git clone https://github.com/mirage/bigarray-compat.git(I believe the presence of dune files containing OCaml syntax is sufficient to trigger their execution and this memory leak) - Use
dune build -wand make some normal edits - Observe that the memory usage increases on every edit (in my project, about 25MB per build)
Specifications
- Version of
dune(output ofdune --version): 3.6.2 - Version of
ocaml(output ofocamlc --version): 4.14.0 or 5.0 - Operating system (distribution and version): Linux 6.1.6
Additional information
dune --trace-file output:
Memtrace output (added to dune 3.6.2 in bin/main.ml):
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

