When I am starting my application under valgrind with massif option I see 52.6 MiB peak usage. But htop says the process took 875MB of RES memory.
The same behavior has heaptrack. Does anyone know why profiler doesn't report where 800+MB gone?
Massif by default measures only the heap managed by malloc
and friends. It doesn't attempt to track pages mapped by other means (for example with mmap
).
In order to account for all pages, one needs to run massif with --pages-as-heap=yes
.
Source: Massif manual.