On Thu, 28 Apr 2016 13:42:12 +0200
Norman Kradepohl
Hi there,
my code is allocating memory and never freeing it, even though it should (at least in my opinion).
[...]
Btw.: I'm working on debian and looking at "/proc/self/status" -> "VmRSS" to whatch the used memory.
The C++ runtime is not required to have a 1-to-1 mapping into the OS for new and delete calls. So in this case the shared_ptr delete calls should be releasing the memory into the C++ runtime, which is holding onto the memory and not releasing it the OS. Valgrind or -fsanitize=address with newish versions of clang or gcc will provide more accurate information on memory leaks. If more precise control over memory management is needed, direct system calls for acquiring and releasing memory will be necessary. Lee