Ivan
Mon Mar 01 18:18:06 CST 2004
Most of the design strategies of the heap are biased towards
fast allocation / deallocation code paths for processes
that have a working-set proportional to the load.
This is particulalry effective in the services space,
where you would want to maintain scalability when the number of clients
grows.
This is one of the main motivation behind the LookAside lists,
that are good on average for 'hot' heaps, and bad from the fragmentation
point of view.
You should consider using Low Fragmentation Heap,
is you have a largely monothreated applicaiton with a very large excursion
in working set.
The only functions that cause a real "compactation" of the heap are
destructive
towards the LookAsides lists, or the LowFrag heap.
HeapWalk is one function that can be used to "force compaction",
but it will flush the LookAsides. HeapValidate completely removes the
LookAsides.
If your application needs to get to a minimal working set,
then you may consider creating and destroying the heap used by your
structures
across different runs of the same algorithm.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Al Havrilla" <anonymous@discussions.microsoft.com> wrote in message
news:DB6F485B-718D-45FC-9C87-06C3E02C8C6F@microsoft.com...
> thanks for the response.
>
> yes, i'm aware of the heap fragmentation caused by the generic C++
program. seems heavy use of CString would excerabate this problem. i
wasn't thinking that CString had bugs.
>
> what, if anything, can be done to "help" the heap. i already do the
normal things like not leaving "newed" objects in memory any longer than
necessary, etc.
>
> should the heapmin() function be run occassionally?
>
> thanks
> Al
>