[AGENT++] How has the memory leak been fixed?

dominik.vogt at external.thalesgroup.com dominik.vogt at external.thalesgroup.com
Tue Sep 7 08:38:56 CEST 2010


On Mon, Sep 06, 2010 at 02:35:34PM +0200, Dominik Vogt wrote:
>    On Mon, Sep 06, 2010 at 02:09:51PM +0200, Dominik Vogt wrote:
>    >    May I ask which changes in agent++-v3.5.31 fixed the memory leak
>    >    with the proxy forwarder?  The CHANGES file does not mention
>    >    anything.
> 
>    Anyway, I reran the test and the situation has improved, but
>    there is still a leak.  With the same test and the same machine as
>    before, memory is now lost at about 1% in five minutes.  The good
>    news is that valgrind now reports only one place where the memory
>    being lost is allocated:
> 
>    ==23172== 20,015,576 (8,809,968 direct, 11,205,608 indirect) bytes in
>    12,658 blocks are definitely lost in loss record 119 of 119
>    ==23172==    at 0x4005B65: operator new(unsigned)
>    (vg_replace_malloc.c:163)
>    ==23172==    by 0x408B4B7: Agentpp::RequestList::receive(int)
>    (request.cpp:1398)
>    ==23172==    by 0x8056A1B: main (agent.cpp:540)
>    ==23172==
>    ==23172== LEAK SUMMARY:
>    ==23172==    definitely lost: 8,809,968 bytes in 12,658 blocks.
>    ==23172==    indirectly lost: 11,205,608 bytes in 178,209 blocks.
>    ==23172==      possibly lost: 17,304 bytes in 45 blocks.
>    ==23172==    still reachable: 13,871 bytes in 287 blocks.
> 
>    All other places with possible leaks may be false alarms or only
>    small amounts of memory that are allocated infrequently.

The two attached patches remove the memory leaks:

- 0001*
  Fixes a memory leak in mib.cpp.  The request must be deleted
  after calling requestList->answer(req).  At least it's deleted
  at the other place where answer() is called.

- 0002*
  Properly clean up the proxy forwarder example program so that
  valgrind does not report still reachable memory at the end of
  execution.

With these two patches the proxy forwarder is free of memory
leaks, as far as I can tell.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
-------------- next part --------------



More information about the AGENTPP mailing list