什么时候/为什么要使用heapmin? [英] When/why should heapmin be used?

查看:102
本文介绍了什么时候/为什么要使用heapmin?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

客户对我们的应用程序有一些内存使用要求.他们指出,虽然我们的承诺内存是合理的,但保留内存却很高.他们怀疑这是因为CRT堆随着我们分配内存而增长,但是在释放内存时CRT不会将页面返回给OS.我们只是使用内置的运算符new/delete/new []/delete []-很少使用malloc/free.

A customer has some memory usage requirements of our application. They note that while our committed memory is reasonable, the reserved memory is high. They suspect this is because the CRT heap grows as we allocate memory, but the CRT isn't returning pages to the OS when the memory is deallocated. We are just using built-in operator new/delete/new[]/delete[] - along with a little usage of malloc/free.

他们问,您的内存管理器是否在以下位置致电 _heapmin 有一点要压缩堆吗?"

They ask, "Does your memory manager call _heapmin at some point to compact the heap?"

ummm,我们没有明确地调用_heapmin.我们应该吗?有使用的经验法则吗?

ummm, we don't explicitly call _heapmin. Should we? Are there any rules of thumb for its use?

推荐答案

在使用CRT内存管理器时,无需显式调用它,操作系统将对此进行管理.

As you are using the CRT memory manager there is no need to call it explicitly the OS will manage this.

这篇关于什么时候/为什么要使用heapmin?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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