Gc.Tweak(3)

πŸ“¦
version 5.5.0 Β· 2 versions
, in arch rolling

🌸 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. Raises Invalid_argument if no such parameter exists. 🚨
  • val get : string -> int β€” retrieve a parameter value. Raises Invalid_argument if 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