Memory analyzer



  • Hi all,

    What memory analyzer do you suggest me to analyze my application on Windows? Is there any free one?



  • Hi,
    you can use
    @#include <windows.h>
    #include <iostream>
    #include <cstdlib>
    #include <stdio.h>
    #include <iomanip>
    #include <sstream>
    #include <string>
    #include <stdlib.h>
    #include <math.h>@
    @
    std::ostringstream stremString;
    std::string resultString;
    DWORDLONG physMemUsed;
    MEMORYSTATUSEX statusExe;
    statusExe.dwLength=sizeof(MEMORYSTATUSEX);
    GlobalMemoryStatusEx(&statusExe);
    physMemUsed = statusExe.ullTotalPhys - statusExe.ullAvailPhys;
    stremString<<" Total Memory " <<(float)(physMemUsed/(1024*1024))<<" Mb ";
    resultString=stremString.str();
    stremString.str("");
    @
    I used it int my a project. This part of the code. You can take something that.



  • If you are in Visual Studio, then VLD (Visual Leaks Detector) works great:
    http://vld.codeplex.com/

    In contrast to the above code, VLD gives you a call stack for each allocation that caused a memory leak.

    And it's free :-)

    --

    Other than that, I have used BoundsChecker and Insure++ at work. But they are not cheap ;-)

    And on Linux you always have Valgrind...


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.