Gc.Tweak(3)
πΈ NAME πΈ
From the OCaml library manual, page Gc.Tweak(3): Gc.Tweak β bestie, these are GC Tweaks, aka unstable and undocumented configurable GC parameters, primarily intended for use by GC developers. π
π¦ MODULE π¦
Module Gc.Tweak β yes ma'am, that's the module, and it's serving exactly that name. β¨
π DOCUMENTATION π
π§ Module Tweak
: sig end
Okay so real talk: GC Tweaks are unstable and undocumented configurable GC parameters, primarily intended for use by GC developers. No cap, they're literally for the GC dev girlies. π«Ά
As well as using Gc.Tweak.set "foo" 42, they can also be configured in OCAMLRUNPARAM, using the following syntax:
OCAMLRUNPARAM='Xfoo=42'
Additionally, OCAMLRUNPARAM=Xhelp will show the available GC tweaks. Iconic behavior, honestly. π
Since 5.5 β periodt. π
val set : string -> int -> unitβ change a parameter. RaisesInvalid_argumentif no such parameter exists. π¨val get : string -> intβ retrieve a parameter value. RaisesInvalid_argumentif no such parameter exists. πval list_active : unit -> (string * int) listβ returns the list of parameters and their values that currently have non-default values. β¨
Shoutout to OCamldoc for serving this on 2026-06-22 β page Gc.Tweak(3) signing off, mwah ππ
π¦ where this page comes from
- arch rolling: ocaml 5.5.0-1 Β· LGPL2.1 AND custom: QPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms