Question on avoiding page faults

Discussion in 'C++' started by benben, Jun 29, 2005.

  1. benben

    benben Guest

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

    ben
    benben, Jun 29, 2005
    #1
    1. Advertising

  2. 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
    Victor Bazarov, Jun 29, 2005
    #2
    1. Advertising

  3. benben

    msalters Guest

    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
    msalters, Jun 29, 2005
    #3
  4. benben

    benben Guest


    > 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
    benben, Jun 30, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave Kirby

    page faults when spawning subprocesses

    Dave Kirby, Nov 9, 2005, in forum: Python
    Replies:
    2
    Views:
    272
    Daniel Kabs
    Nov 9, 2005
  2. Sune
    Replies:
    26
    Views:
    695
    Lawrence Kirby
    Aug 1, 2005
  3. cablitoEscobar

    CreateToolhelp32Snapshot Page Faults

    cablitoEscobar, Sep 27, 2006, in forum: C++
    Replies:
    1
    Views:
    558
    Victor Bazarov
    Sep 27, 2006
  4. none

    Acceptable level of page faults

    none, Nov 9, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    8,491
  5. David Morgan
    Replies:
    2
    Views:
    269
    Anthony Jones
    Jun 9, 2006
Loading...

Share This Page