Library
Module
Module type
Parameter
Class
Class type
Compute memory usage of OCaml heap values (by recursively inspecting runtime representation)
Information gathered while walking through values.
val objsize : 'a -> info
Returns information for first argument.
val objsize_limit : int -> 'a -> info
objsize_limit limit v
val size_with_headers : info -> int
Calculate size in bytes
val size_without_headers : info -> int
val objsize_roots : unit -> info
Walk through all the roots and return information for the whole heap.
val objsize_roots_limit : int -> info
Walk through all the roots and return information for the whole heap. Integer parameter limits the maximum depth to follow (to prevent excess stack usage). If maximum depth is reached during heap traversal then the returned result may be less than actual. One can detect this situation by comparing returned depth against the limit.
sub next base
calculate next - base
, i.e. the changes from base
to next
.
val show_info : ?map:(int -> string) -> info -> string
val show_tags : ?map:(int -> string) -> info -> string list