-2

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.

Tryer
  • 3,580
  • 1
  • 26
  • 49
  • ::sigh:: I have nothing to do with Intel V Tune. I am genuinely curious to know if there are features of Valgrind that I am missing out on. Pop quiz: How would you differentiate between an ad and a genuine question? Is there any adjective/verbs that I did not properly use? Did the tone of my OP come across some wrong way ? Disappointing to know that objective developers living in the real world looking to use the best possible tool to improve their productivity now have to worry about how their questions come across. – Tryer Dec 22 '21 at 05:53
  • How is this related to C++? – kiner_shah Dec 22 '21 at 05:54

1 Answers1

2

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.

Paul Floyd
  • 5,530
  • 5
  • 29
  • 43
  • I ended up buying a pure linux machine just to run valgrind actually since I knew it would not work on windows and there were not enough free tools on windows at that time that detected leaks. I believe one more feature that valgrind offers is a call graph via KCachegrind. This seems difficult to obtain in VTune. Indeed you are right about Valgrind natively on windows. One workaround would be WSL on Windows. However, KCachegrind seems to be a gui based tool that is not possible to have on WSL/Windows. – Tryer Dec 22 '21 at 10:12