I have got a memory leak which I'm trying to track with massif. The problem is that the leak happens always like couple of hours after an app is started. Now application that runs on massif is about 20 times slower than normal, thus for the leak to happen I must wait like 100 hours or more. I was even trying to wait this time, but it happened that no leak was there. I suspect that the leaks may somehow occur only when my project is running on full speed? Since it is not possible to attach valgrind to running process, is there maybe the way to postpone valgrind so it will collect the data after some time, or even better on the request? This way I could wait some time when the program is running fine (with hopefully normal speed), and start logging at the moment leaks are occurring.
Any help is appreciated.