visual-c++visual-studio-2013visual-leak-detector

Visual leak detector uses more time than usual


I observe that the application takes enormously large time than the normal functioning of the exe when used with visual leak detector. I understand it will normally take more time, but this is taking really more time, Does it depend on the usage of ppl libraries or something??


Solution

  • It is completely normal. Visual leak detector calls StackWalk64() for every c/c++ memory allocation (via CrtSetAllocHook) and logs the results - which adds formidable overhead. The more your program calls new() / malloc(), the heavier the burdeon - and most programs make tons of memory allocations, even indirectly.

    Don't use it for regular runs, only when trying to debug specific leaks. And even then I'd consider using the CRT built in alternatives.