Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Page faults are not caused when memory is allocated, but when memory is used. And allocated memory is not "commit"ted; it will be swapped out and back in as the OS sees fit, so re-allocating that space can certainly cause plenty of page faults, even if no "new requests to the OS" are made directly.

Excessive page faults causing a system to be very slow happens when there isn't enough physical memory for all of the running processes to have the things they need resident at the same time. Playing games with when memory is allocated is unlikely to make a big difference in such a scenario in my experience.

No transitions form user mode to kernel mode. One page fault.

That seems to nicely sum up your confusion. Page faults happen as interrupts, not as calls from user mode into kernel mode. You cannot prevent page faults by avoiding calling into the kernel. Just about any time you access any byte of memory, a page fault could happen. Even allocating a big chunk of memory with a single call into the OS will surely cause more than one page fault.

- tye        


In reply to Re^2: RFC: Abusing "virtual" memory (page faults vs malloc) by tye
in thread RFC: Abusing "virtual" memory by sundialsvc4

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (4)
    As of 2021-01-19 03:14 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Notices?