By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,463 Members | 3,115 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,463 IT Pros & Developers. It's quick & easy.

Question on avoiding page faults

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

ben
Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a


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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.