On Tue, Feb 23, 2010 at 9:39 AM, Madhan Kanagavel <madhan@yahoo.com> wrote:
Hello,

We have been running a Boost ASIO 1.40 based server successfully for a while, handling hundreds of connections without any issues.
But we recently saw some unusual memory usage and started digging into it a bit.

We use Asynchronous IO with SSL.
We are seeing that in the server side every time a connection occurs some memory is being used up and never getting really freed after the connection goes away.
We use Resident Memory value of the server to measure memory usage of the server process.

This occurs only in Linux, works fine under Windows.

I once had a similar problem, but looking over the code it doesn't seem to be suffering the same problem that was occuring in my situation.  In my situation, I had a thread_group, and upon thread termination i was not removing the connection thread from the thread_group. 

Maybe you can use valgrind's memory checkpoint capabilities.  Checkpoint at the start of the program, run one connection, shutdown the io_service, then checkpoint again and get a diff.