I'm developing a c++ program. This program seems to leak sometimes. Then it suddenly grows 2/3 times in size and keeps growing up to out of memory. "Run it in valgrind" you would say. I do, but the strange thing is that at exit, it shows leakage of "only" 0.5MB. Not the gigabytes I see using "top" (RSS).
The program is a program which monitors 10 webcams. They produce a constant fps, a constant resolution, rtsp or mjpeg stream. Nothing of that changes. Time periods are: days(!) of constant memory usage and then suddenly memory usage starts to grow:
So question now is: any tips for how to figure out these kinds of problems?