Just to add a few more details. When running under Valgrind, you will have
- two stacks, one for the Valgrind host, one for the guest application
- two 'text segments' mapped into memory (that's the machine code from the binaries of the host and the client + client shared libraries)
- other stuff like data segments
In addition, each tool will use memory for whatever tracking it is doing, as @phd already mentioned. So for example memcheck will allocate 'shadow' memory so that it can tell when the client uses uninitialized memory.
Finally, if you run Valgrind with debug output (-d), it will print its own "address space manager" map, which is similar to pmap -x
.