Enum profile_traits::mem::ReportKind
source · pub enum ReportKind {
ExplicitJemallocHeapSize,
ExplicitSystemHeapSize,
ExplicitNonHeapSize,
ExplicitUnknownLocationSize,
NonExplicitSize,
}
Expand description
The various kinds of memory measurement.
Here “explicit” means explicit memory allocations done by the application. It includes allocations made at the OS level (via functions such as VirtualAlloc, vm_allocate, and mmap), allocations made at the heap allocation level (via functions such as malloc, calloc, realloc, memalign, operator new, and operator new[]) and where possible, the overhead of the heap allocator itself. It excludes memory that is mapped implicitly such as code and data segments, and thread stacks. “explicit” is not guaranteed to cover every explicit allocation, but it does cover most (including the entire heap), and therefore it is the single best number to focus on when trying to reduce memory usage.
Variants§
ExplicitJemallocHeapSize
A size measurement for an explicit allocation on the jemalloc heap. This should be used
for any measurements done via the MallocSizeOf
trait.
ExplicitSystemHeapSize
A size measurement for an explicit allocation on the system heap. Only likely to be used for external C or C++ libraries that don’t use jemalloc.
ExplicitNonHeapSize
A size measurement for an explicit allocation not on the heap, e.g. via mmap().
ExplicitUnknownLocationSize
A size measurement for an explicit allocation whose location is unknown or uncertain.
NonExplicitSize
A size measurement for a non-explicit allocation. This kind is used for global measurements such as “resident” and “vsize”, and also for measurements that cross-cut the measurements grouped under “explicit”, e.g. by grouping those measurements in a way that’s different to how they are grouped under “explicit”.