Boost logo

Boost Users :

Subject: Re: [Boost-users] Memory deallocation concerning boost::bind, boost::asio and shared_ptr
From: Oswin Krause (Oswin.Krause_at_[hidden])
Date: 2016-05-10 09:30:24


The exact behaviour depends on your run-time implementation.
It is most likely not very much memory that the run-time is claiming.
Have you seen any issue in practice? Or is it a theoretical problem like
"when do I get my 2 MB of my 64GB memory back?"

On 2016-05-10 14:40, Norman wrote:
> I understand, that the RSS is not a direct indicator for 'unused'
> memory.
> Since I obviously have problems to clearify my problem, i made another
> example:
> Converging memory consumption example
> <>
> 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.
> --
> View this message in context:
> Sent from the Boost - Users mailing list archive at
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at