Boost logo

Boost Users :

Subject: Re: [Boost-users] Memory Leak with ASIO SSL examples on Linux in Boost 1.40
From: Zachary Turner (divisortheory_at_[hidden])
Date: 2010-02-23 14:54:39


On Tue, Feb 23, 2010 at 9:39 AM, Madhan Kanagavel <madhan_at_[hidden]> 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.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net