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 =
| Normal
| Marshal
| Custom
type allocation = private Stdlib__gc.Memprof.allocation = {
n_samples : int;
size : int;
source : allocation_source;
callstack : Stdlib.Printexc.raw_backtrace;
}
type (!'minor, !'major) tracker = ('minor'major) Stdlib__gc.Memprof.tracker = {
alloc_minor : allocation -> 'minor option;
alloc_major : allocation -> 'major option;
promote : 'minor -> 'major option;
dealloc_minor : 'minor -> unit;
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