Memory leak debuging
-
Hi,
I am new here. I am working on a Qt project version(QT5.6.3).It is a application for outputing text and graphical things.
The main problem is: If the application runs for some hours, the memory increases, about 9MB per hour!
Anybody ideas how to detect this problem, or any useful tools for detecting such problems?
Thank you. -
@JoSchn
Then I would look into the memory analysis tools which I believe are supplied with VS 2013.You could try a valgrind substitute like e.g. Valgrind for Windows (which is Deleaker), which says it works for VS, but whether for VS 2013 I don't know. My first thought would be to try whatever MS supply in VS 2013 for this.
-
Have a look at Qt Creator's Detecting Memory Leaks with Heob.
-
@cristian-adam
Hi. That github repo only mentions MinGW and MSVC. Neither it nor the Qt docs page say anything about platforms. Is it Linux too? -
It looks like a Windows only solution, which is fine since Valgrind is available for Unix.
-
@cristian-adam
Sure, i was just asking because I am a Linux Qt user and had not heard of it! :) Fine for the OP here! -
MTuner and Visual Leak Detector are both excellent tools that helped me in the past with leak detection.
Also, if you can run your app under the debugger Visual Studio has a built in memory profiler. You can take snapshots of your process memory before and after some period of time and see allocations with callstacks made in between. I don't think it was available in VS2013, but you can use a never version of the IDE only for debugging. -
Besides Heob you can use Find memory leaks with the CRT library which is specific to MSVC, and the cross platform version at A Cross-Platform Memory Leak Detector.