What are the negative consequences of turning off the debug heap? (_NO_DEBUG_HEAP == 1)

The initial phase of my program loads significant amounts of data into STL containers. I found that it took several minutes before I could reach the real meat of my program.

After some searching, I found that I can set _NO_DEBUG_HEAP == 1 in my VS2012 Configuration → Debugging-> Environment ... configuration variable to disable the use of the window debugging heap. This gave me a 10x improvement in debugging speed. I have not yet found a description of what debugging functions I lose by doing this.

In short: what checks were performed and what debugging information was generated using the Windows debug heap?

Thanks.

+7
source share
1 answer

The debug heap affects performance in two ways:

First, it adds heap integrity checks during heap operations. I did not find details about these checks, but it is assumed that for each distribution or for free, it includes checking the integrity of the data structures used to manage the heap.

Secondly, it disables the low fragmentation heap (LFH) parameter. In the default release build, you get LFH. In a debug assembly, you are not ... unless you are using _NO_DEBUG_HEAP. This is not necessarily a speed limit, but it can be.

The documentation has links to HeapSetInformation .

Note that C and C ++ run-time libraries provide memory management built on top of the system heap API, and also have debugging and debugging modes that can affect performance. There is more detailed documentation on what the debug CRT does. You can check and see if disabling CRT debugging is enough for you to significantly improve performance without going into process debug heap mode.

+3
source

All Articles