#include
#include
using namespace std;
int main()
{
vector< vector > dp(50000, vector(4, -1));
c
The debug heap automatically gets enabled when you start your program in the debugger, as opposed to attaching to an already-running program with the debugger.
The book Advanced Windows Debugging by Mario Hewardt and Daniel Pravat has some decent information about the Windows heap, and it turns out that the chapter on heaps is up on the web site as a sample chapter.
Page 281 has a sidebar about "Attaching Versus Starting the Process Under the Debugger":
When starting the process under the debugger, the heap manager modifies all requests to create new heaps and change the heap creation flags to enable debug-friendly heaps (unless the _NO_DEBUG_HEAP environment variable is set to 1). In comparison, attaching to an already-running process, the heaps in the process have already been created using default heap creation flags and will not have the debug-friendly flags set (unless explicitly set by the application).
(Also: a semi-related question, where I posted part of this answer before.)