Dr Memory is an open source free memory detection tool that detects memory-related programming errors such as uninitialized access, illegal memory access, and memory leaks. Not only can it work under Linux, but it can also work on Microsoft's Windows operating system. However, when this article was written, Drmemory only supported 32-bit programs, which was a huge flaw, but believe that as development progresses, Drmemory will launch a version that supports 64-bit programs.
Dr Memory is similar to Valgrind, and can directly check the compiled executable. Users do not have to overwrite the source code of the program being checked, nor do they need to relink the Third-party library files, which is very convenient to use.
Dr Memory is built on the Dynamorio dynamic binary piling platform. Dynamic monitoring program operation, and memory access related to the implementation of the code to dynamically modify, record its behavior, and the use of advanced algorithms for error checking.
According to Drmemory http://www.aliyun.com/zixun/aggregation/7155.html "> A paper published by developers on CGO 2011 practical Memory with Dr. Memory,drmemory has less impact on the normal execution of programs, which is more advanced in similar tools. Its configured and Valgrind comparisons are shown in Figure 1 (the picture originates from the Drmemory homepage):
Figure 1. and Valgrind Performance Comparison
Valgrind has a large impact on the normal operation of the program, in general, if the full memory testing, the program can run 50 to 300 times times slower. Drmemory has some advantages in this respect.
Ease of use and performance are the main benefits of drmemory, and drmemory can be used to debug Windows programs, so it is widely considered a valgrind alternative on Windows. In the Linux platform, Drmemory can also often be a choice other than Valgrind.
Drmemory the memory leak monitoring using a relatively unique algorithm, a large number of reduced "false positive", that is, false errors. If you still can't find memory errors in your program with tools such as Valgrind, try Drmemory.
On Linux, the current version of Drmemory is not yet able to debug 64-bit programs, which is a relatively large disadvantage.
Drmemory Installation
On Linux, installing Dr Memory is very simple, simply unzip the download package, such as:
TAR–XZVF drmemory-linux-1.4.6-2.tar.gz
To use Drmemory, make sure that the following software is installed correctly:
Perl, Objdump, Addr2line.
In any current Linux distribution, these software should all be installed, so basically you just need to download the Drmemory tar package and then unzip it to use it.
Drmemory on Windows provides an executable installation package that can be installed by simply clicking the next step.