Module CObj

Physical size of an ocaml value.

These functions explore objects recursively and may allocate a lot.

val size : 'a -> int

Physical size of an object in words.

val size_b : 'a -> int

Same as size in bytes.

val size_kb : 'a -> int

Same as size in kilobytes.

Physical size of an ocaml value with sharing.
val register_shared_size : 'a -> unit
val shared_size_of_obj : 'a -> int
val shared_size_of_pos : int list -> int
Logical size of an OCaml value.
val obj_stats : 'a -> int * int * int

Return the (logical) value size, the string size, and the maximum depth of the object. This loops on cyclic structures.

Total size of the allocated ocaml heap.
val heap_size : unit -> int

Heap size, in words.

val heap_size_kb : unit -> int

Heap size, in kilobytes.