In this example, the amount of memory beeing allocated by the programm
converges to a limit, which shows exactly what you told me. So the C++
runtime holds on to some allocated memory, even though the objects have been
'freed', meaning that the application does not need to allocate more memory
for every function call.
My problem with this behaviour is, that my application should run for an
infinit amount of time. It's a server application, which allocates a greater
amount of memory in between. So if this memory is allocated for a little
while, even when the memory is 'not in use' anymore, that's fine with me.
But at some time, the memory needs to be released to the OS. And that's
exactly where my problem appears. I don't know, if the memory will ever be
reclaimed by the OS. Of course, RSS does not tell me how much memory my
application is currently using, but it tells me at least the minimum amount
of memory currently managed by the C++ runtime. And if this increases to a
huge amount, my OS does not have access to this memory, right?
So my remaining question is, if the ioService object will (or more precisly
the C++ runtime) will ever release the allocated memory to the OS or if i
have to do this manually.