473,405 Members | 2,444 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,405 software developers and data experts.

Question on avoiding page faults

Is there a standard guidline to avoid or minimize page faults when
manipulating data collections in C++?

ben
Jul 23 '05 #1
3 2705
benben wrote:
Is there a standard guidline to avoid or minimize page faults when
manipulating data collections in C++?


Stay away from bare pointers and dynamic memory management.

V
Jul 23 '05 #2


Victor Bazarov wrote:
benben wrote:
Is there a standard guidline to avoid or minimize page faults when
manipulating data collections in C++?


Stay away from bare pointers and dynamic memory management.

V


Eh? That avoids the undefined-behavior page faults. You
don't want to minimize those, elimination is the only
reasonable goal. The term "minimize" suggests to me he
refers to those page faults that cause swapping.

In that case, you're worried about data locality and
limiting memory use. That's not directly C++ related,
although C++ techniques like Small-String optimalization
are invented for just that purpose.

Other methods involve replacing owning pointers in objects
by the objects pointed to (e.g. undoing the pimpl idiom,
which trades runtime performance for compile time) and
using smaller data types like float/short.

HTH,
Michiel Salters

Jul 23 '05 #3
Eh? That avoids the undefined-behavior page faults. You
don't want to minimize those, elimination is the only
reasonable goal. The term "minimize" suggests to me he
refers to those page faults that cause swapping.
Yes! I meant how to minimize page swapping.

In that case, you're worried about data locality and
limiting memory use. That's not directly C++ related,
although C++ techniques like Small-String optimalization
are invented for just that purpose.

Other methods involve replacing owning pointers in objects
by the objects pointed to (e.g. undoing the pimpl idiom,
which trades runtime performance for compile time) and
using smaller data types like float/short.

HTH,
Michiel Salters


Thank you for that!
ben
Jul 23 '05 #4

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

Similar topics

3
by: Randell D. | last post by:
Folks, I'm still learning javascript - I've invested in a couple of books and reading online as much as possible. I'm pretty sure what I am suggesting is possible though I'm trying to weigh up...
2
by: Dave Kirby | last post by:
I am working on a network management program written in python that has multiple threads (typically 20+) spawning subprocesses which are used to communicate with other systems on the network. This...
4
by: tbatwork828 | last post by:
Related to my other post on Graphics.FillRectangle and a lot of page faults caused by this call... We determine that when Control.DoubleBuffer=true to avoid the flicker effect,...
0
by: Crirus | last post by:
Hello! I cant understand why my application generate lots of page faults as task manager shows... Something related to MouseMove, I guess...I scroll a large bitmap with MouseMove and seems that...
2
by: Crirus | last post by:
I made a simple test... loaded an image from file and draw it on a form In mouse move, I just refresh the form.... that cause 1 000 000 page faults (as task manager shows) in less than a minute.....
2
by: David Morgan | last post by:
Hi Have 4Gb of RAM and plenty of free disk. Those page faults are for DLLHOST.EXE using ~370Mb RAM. inetinfo.exe has 403,106,036 page faults at the time of writing and is using ~145Mb RAM. ...
4
by: bjorn.augestad | last post by:
Hi, all. We have a couple of pathological sql servers that have lots and lots of page faults per second, up to 4000. Our client programs are written in C#/.NET 1.1 and utilizes connection...
1
by: cablitoEscobar | last post by:
The problem lies in the fact that whenever I call CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0) a page fault occurs. The fact is I have a timer set to take a snap-shot per second and the...
4
by: none | last post by:
I have an ASP.NET application, hosted on two web servers. I am looking for advice on what should be an acceptable level of page faults on these production servers. If the acceptable level is zero,...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.