关闭调试堆的负面后果是什么? (_NO_DEBUG_HEAP == 1) [英] What are the negative consequences of turning debug heap off? (_NO_DEBUG_HEAP==1)

查看:467
本文介绍了关闭调试堆的负面后果是什么? (_NO_DEBUG_HEAP == 1)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序的初始阶段将大量数据加载到STL容器中。我发现需要几分钟的时间才能达到我程序的真实目的。



经过一些搜索,我发现我可以在我的...中设置_NO_DEBUG_HEAP == 1 VS2012配置属性 - >调试 - >环境变量...关闭Windows调试堆的利用率。这使我的调试速度提高了10倍。我还没有找到任何描述什么调试功能我失去了这样做。



总结:使用Windows调试堆完成什么检查和生成调试信息?



解决方案

调试堆以两种方式影响性能:



首先,它在堆操作期间添加对堆完整性的检查。我没有找到这些检查的细节,但是一个假设在每个分配或免费的情况下,它涉及验证用于管理堆的数据结构的完整性。



第二,它禁用低碎片堆(LFH)选项。在发布版本中,默认情况下您将获得LFH。在调试版本中,不要使用_NO_DEBUG_HEAP。这不一定是速度罚款,但可能是。



有关 HeapSetInformation 。 p>

请注意,C和C ++运行时库提供了构建在系统堆API之上的内存管理,并且还具有可能影响性能的调试和非调试模式。有关于什么的更详细的文档调试CRT。您可以检查并查看关闭CRT调试是否足以让您显着提升性能,而不会影响进程堆的调试模式。


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

After some searching, I found that I could set _NO_DEBUG_HEAP==1 within my VS2012 Configuration Properties->Debugging->Environment variable...turning off utilization of the windows debug heap. This gave me a 10x improvement in debugging speed. I have not yet found any description what what debugging functionality I lose by doing so.

In summary: what checks were completed and what debug info was being generated by using the windows debug heap?

Thank you.

解决方案

The debug heap impacts performance in two ways:

First, it adds checks to the heap integrity during heap operations. I haven't found details on these checks, but one assumes that on each allocation or free, it involves verifying the integrity of the data structures used to manage the heap.

Second, it disables the low-fragmentation heap (LFH) option. In a release build, you get LFH by default. In a debug build, you don't--unless you use the _NO_DEBUG_HEAP. This isn't necessarily a speed penalty, but it might be.

There are clues in the documentation for HeapSetInformation.

Note that the C and C++ runtime libraries provide memory management built on top of the system heap APIs, and they also have debug and non-debug modes that can affect performance. There is more detailed documentation about what the debug CRT does. You might check and see if turning off the CRT debugging is enough to get you a significant boost in performance without messing with the debug mode of the process heap.

这篇关于关闭调试堆的负面后果是什么? (_NO_DEBUG_HEAP == 1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆