How much memory was actually allocated from heap for an object?

前端 未结 6 702
渐次进展
渐次进展 2020-12-30 17:09

I have a program that uses way too much memory for allocating numerous small objects on heap. So I would like to investigate into ways to optimize it. The program is compile

6条回答
  •  庸人自扰
    2020-12-30 17:35

    Under Windows you can use the Heap32First and HEAPENTRY32 structures to determine the size of any given heap entry, assuming you are not using a customised heap manager. It is also worth pointing out that the size of an allocated block is liable to be larger in debug than release builds due to guard bytes. I don't see mention of Heap64 functions in MSDN so I guess they simply use the Heap32 name.

提交回复
热议问题