I have written a C++ application, that runs forever until terminated manually.
It monitors other important applications. As a result my Daemon application should not go down.
Keeping that in mind, I want to see if there are any memory leaks in my application.
I used valgrind but since this application keeps running forever the valgrind does not exit. if I do a control – C then I don’t get complete info from the valgrind logfile.
Is there a tool that can do what Valgrind does?
I believe you can connect gdb to a running valgrind process, and instruct it to run a leak check explicitly.
I haven’t tried this, just seen it in the docs.
In case of link breakage:
Connecting GDB to a Valgrind gdbserver
(the error parameter is the number of errors before the gdbserver becomes active: zero means it starts running right away).
Then start gdb on your program and connect to the remote target
and to trigger the check
See your docs or the linked ones for full details.