How to check the memory leak
-
I use the
#ifdef _DEBUG #define new DEBUG_NEW #endif
to check the memory leak, but it output a lot of non-useful info, Is there good way to check where the memory leak?normally when u create project in Visual studio ,and after debugging it (ofcourse in debug mode) , when u close the app, Visual studio will shows any unfreezed memory in the output window( ALT+CTRL+ O). sometimes this information is sufficient to detect the memory leak(depends on codes and the persons knowledge) if u r trying to find memory leak and vs's output is not sufficient try using boundsckecer or similar softwares ( http://en.wikipedia.org/wiki/BoundsChecker) . Boundschecker is not free. visual leak detector is a free one(http://www.codeproject.com/KB/applications/visualleakdetector.aspx) hopes this helps.
If u can Dream... U can do it
-
I use the
#ifdef _DEBUG #define new DEBUG_NEW #endif
to check the memory leak, but it output a lot of non-useful info, Is there good way to check where the memory leak?HI This macro can only report the memory leak that has been made by new.
-
I use the
#ifdef _DEBUG #define new DEBUG_NEW #endif
to check the memory leak, but it output a lot of non-useful info, Is there good way to check where the memory leak?Assuming you have no calls to calloc and malloc, ... http://stackoverflow.com/questions/3509214/overloading-new-and-delete-in-c An exception could be the source of the problem since class destructors are not called if an exception is encountered and not handled.
-
I use the
#ifdef _DEBUG #define new DEBUG_NEW #endif
to check the memory leak, but it output a lot of non-useful info, Is there good way to check where the memory leak? -
I use the
#ifdef _DEBUG #define new DEBUG_NEW #endif
to check the memory leak, but it output a lot of non-useful info, Is there good way to check where the memory leak?