VC++ memory management functions

D

David.C.Dunn

(previously posted on microsoft.public.languages.vc)

We're about to make a major release. Recently I have been testing the
use of the low fragmentation heap that comes with Visual C++ 2005. We
ship libraries and in our release notes we would like to offer some
tips on how to developers integrating our components on how to get the
best performance.

Previously we recommended _set_sbh_threshold(1016) to improve
performance. Running our tests with the low fragmentation heap enabled
results in speed-ups in 99% of our tests. However a few of the tests
demonstrate severe speed degradation. In these we allocate of the order
of 100,000 small object (typically 72 bytes). If I enable the low
fragmentation heap AND call the _set_sbh_threshold() function, we seem
to recover the loss. However I cannot find any documentation that will
answer the following questions:

a) Is it possible to overflow the buckets in the low fragmenation heap?
If so, what happens, and could it account for the slowdown?

b) Are the calls for sbh and lfh compatible - will the objects be
allocated on different heaps at runtime? Is it sane to call them both?

Any advice would be greatly appreciated.

David Dunn
 
B

Ben Voigt

(previously posted on microsoft.public.languages.vc)

Which was the right place to ask, because your question has nothing to do
with .NET (however using a garbage collector might help you a lot). You
also have a lot of answers there from knowledgable people.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top