Module Memprof_limits.Memprof

Use this reimplementation of the Memprof interface if you need to profile a program that uses Memprof-limits.

Note: the expectancy (1/sampling_rate) provided in Memprof.start is rounded to the nearest integer for the accuracy of allocation limits accounting.

include module type of Stdlib.Gc.Memprof
type allocation_source = Stdlib__Gc.Memprof.allocation_source =
  1. | Normal
  2. | Marshal
  3. | Custom
type allocation = private Stdlib__Gc.Memprof.allocation = {
  1. n_samples : int;
  2. size : int;
  3. source : allocation_source;
  4. callstack : Stdlib.Printexc.raw_backtrace;
}
type (!'minor, !'major) tracker = ('minor, 'major) Stdlib__Gc.Memprof.tracker = {
  1. alloc_minor : allocation -> 'minor option;
  2. alloc_major : allocation -> 'major option;
  3. promote : 'minor -> 'major option;
  4. dealloc_minor : 'minor -> unit;
  5. dealloc_major : 'major -> unit;
}
val null_tracker : ('minor, 'major) tracker
val start : sampling_rate:float -> ?callstack_size:int -> ('minor, 'major) tracker -> unit
val stop : unit -> unit