473,396 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

VC++ memory management functions

(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

Jan 23 '07 #1
1 2998

<Da**********@googlemail.comwrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...
(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.
>
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

Jan 24 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: MRe | last post by:
Hi, I'm new to PHP programming (coming from C++); and all is well, except when it comes to memory management. Particularly, with passing objects/arrays in and out of functions. I've had so many...
17
by: ~Gee | last post by:
Hi Folks! Please see the program below: 1 #include<iostream> 2 #include<list> 3 #include <unistd.h> 4 using namespace std; 5 int main() 6 { 7 {
2
by: DANIEL BEAULIEU J | last post by:
Basically i am a student taking an operating systems course which is c++ intensive. Familiar with Java, and so not so familiar with memory management. Looking for suggestions of exercises or web...
7
by: Dan Nilsen | last post by:
Hi! I'm writing a small piece of software that basically runs on an embedded system with a Power-PC cpu. This runs on a stripped down version of Linux - Busybox. As I'm writing a piece of...
12
by: ira2402 | last post by:
Hi All, We are developing sw for a small embedded OS and we have limited memory. We are looking for algorithms, links, and articles about this. The goal is efficient utilization of small amount...
1
by: Mark Jerde | last post by:
Yesterday I posted the message below to microsoft.public.dotnet.languages.vb and microsoft.public.vc.language. The two replies are also posted. I need to write some ISO C++ functions, more...
1
by: Bob | last post by:
I would appreciate any suggestions on handling the following... I currently have a VC++ MDI Application. The core pieces/products are all handled in separate dll's. Our shop has slowly been...
0
by: bluter | last post by:
I have a problem with some VC++ (v5 sp3 compiled in debug mode) server component which perfrom Data Acces. These have been in production on NT4.0 and w2k. However when we try to use them on Server...
94
by: smnoff | last post by:
I have searched the internet for malloc and dynamic malloc; however, I still don't know or readily see what is general way to allocate memory to char * variable that I want to assign the substring...
17
by: Fabry | last post by:
Hi All, I'm new of this group and I do not know if this is the correct group for my question. I have a DLL with its export library (.lib) wrote in Borland C++ 6. In borland everything is OK and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.