package jemalloc

  1. Overview
  2. Docs
On This Page
  1. malloc interface
Legend:
Library
Module
Module type
Parameter
Class
Class type

Bindings to jemalloc. Monitor memory usage and control behaviour of jemalloc.

malloc interface

val release_free_memory : unit -> unit

Release as much memory as possible to operating system

exception Invalid_property of string
val version : unit -> string * int * int * string
  • returns

    version information: (human-readable string, major, minor, git version)

val mallctl_bool : string -> bool option -> bool
val mallctl_int : string -> int option -> int
val mallctl_string : string -> string option -> string
val mallctl_unit : string -> unit
type memory_stats = {
  1. active : int;
  2. resident : int;
  3. allocated : int;
  4. mapped : int;
}
val epoch : unit -> unit

epoch counter for the stats. Statistics are frozen to a snapshot value until the next epoch call refresh the snapshot

val get_stat : string -> int
  • returns

    stat counter from the "stats." mallctl prefix during current epoch

val get_memory_stats : unit -> memory_stats

refresh epoch and gather memory statistics

  • returns

    memory_stats

OCaml

Innovation. Community. Security.