-
August 20th, 2006, 11:57 AM
#1
Help with the heap
I have written two classes: GHeap_Block and GHeap, in which I assuage the task of handling heaps. One of the GHeap constructors enables the creation of an ever-growing heap. Whenever the number of bytes in a heap block dependent upon a heap exceeds its size Windows automatically allocates more memory for the heap. However, it has come to my attention that when a heap_block is freed, the memory it occupied is still allocated by the heap. Thus, the heap is ever growing. Is there any way in which I can make it so that the heap shrinks at the appropriate time?
BTW, originally I accidently titled this, "Does the heap ever sleep?" I did not intend to title it that. I tried to change it to, "Help with the heap"
Last edited by Guidosoft; August 20th, 2006 at 12:12 PM.
Reason: Accident in the title.
-
August 23rd, 2006, 08:04 AM
#2
Re: Help with the heap
Originally Posted by Guidosoft
BTW, originally I accidently titled this, "Does the heap ever sleep?" I did not intend to title it that. I tried to change it to, "Help with the heap"
Done... title changed.
-
August 23rd, 2006, 12:20 PM
#3
Re: Help with the heap
Originally Posted by Guidosoft
IIs there any way in which I can make it so that the heap shrinks at the appropriate time?
HeapCompact
The HeapCompact function attempts to compact a specified heap. It compacts the heap by coalescing adjacent free blocks of memory and decommitting large free blocks of memory.
SIZE_T HeapCompact(
HANDLE hHeap,
DWORD dwFlags
);
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|