Title: Memory debugging under Windows with drmemory
Date: 2014-01-06 1:50

For C/C++ projects in Linux, the reference tools to spot memory corruption and memleaks if of course [Valgrind](http://www.valgrind.org/). But I'm currently coding on Windows during my internship, and despite that fact that I like valgrind
very much, my hate for the command line in Windows is much greater.

I gave a try to [drmemory](https://code.google.com/p/drmemory/) and fell in love immediately:

- Free software
- Integration with Visual Studio
- Quicker than valgrind
- Dead simple to install

# Installation
The process is pretty straightforward: [Get it](https://code.google.com/p/drmemory/downloads/list), install it, and set the following flags in VS to get nice backtraces:

- */Zi* enables debug data
- */Ob0* disables inlining
- */Oy-* disables frame pointer optimization
- */DEBUG* tells the linker to be nice


# Integration with Visual Studio
Go to "Tools", "External Tools", "Add", and fill the fields:
	
	Title: Dr. Memory
	Command: C:\Program Files (x86)\Dr. Memory\bin\drmemory.exe
	Arguments: -visual_studio -- $(TargetPath)
	Initial Directory: $(TargetDir)

# Enjoy
And that's it, you can now click on the "Dr. Memory" item in your *Tools* menu to launch your binary within drmemory.
