Search code examples
c++profilingvalgrindintel-vtune

Intel VTune / Memory Leak Detector -- what additional feature does Valgrind provide


Consider following code:

int main() {
    for (int i = 0; i < 10; i++)
        int *a = new int[10];
}

Intel VTune Profiler/Inspector is now a free suite from Intel available for both Windows as well as Linux (previously, the full version was only available free for academic noncommercial use). The memory leak detector that comes as part of that is able to figure out the leaking line:

enter image description here

Likewise, the suite provides for algorithm hotspot detection, and provide suggestions for vectorization and parallelization. It provides inputs in terms of whether the algorithm is memory bound on processor bound.

Given this, I would like to know what features valgrind provides that is not provided by VTune Profiler. I know that valgrind comes with Memcheck, Cachegrind, Callgrind, etc., but it seems to me that these are all available with VTune. Furthermore, VTune is integrable within the Visual Studio IDE.


Solution

  • Valgrind works on several non-Intel architectures: ARM, POWER, MIPS. I don't know how well VTune works on AMD hardware.

    Valgrind doesn't run natively on Windows, but it does run on FreeBSD, Solaris and (not very well on) macOS.

    VTune and Valgrind features have some overlap but are not identical. Valgrind does not use performance counters. I don't have any experience with Inspector, but it seems to be roughly the equivalent of memcheck and drd/helgrind.

    Lastly, Valgrind can be built and used without any special privileges whilst afaik VTune needs admin rights to install and has more restrictions on running it.