I am using valgrind on a program which runs an infinite loop.
As memcheck displays the memory leaks after the end of the program, but as my program has infinite loop it will never end.
So is there any way i can forcefully dump the data from valgrind time to time.
Thanks
Have a look at the client requests feature of
memcheck
. You can probably useVALGRIND_DO_LEAK_CHECK
or similar.EDIT:
In response to the statement above that this doesn't work. Here is an example program which loops forever:
When I run this in valgrind, I get an endless output of new leaks:
The program does not terminate.