<!– wp:paragraph –>
<p>A <strong>page fault</strong> is an event that occurs when a process tries to access a <a href=”/glossary/page-virtual-memory”><strong>memory page</strong></a> that is not currently loaded in <strong>RAM</strong>.</p>
<!– /wp:paragraph –>
<!– wp:paragraph –>
<p>This mechanism is part of <a href=”/glossary/virtual-memory”><strong>virtual memory</strong></a> and allows processes to use more memory than is physically available. When a <em>page fault</em> is detected, the operating system pauses the process, loads the required page from disk (swap space), and then resumes execution.</p>
<!– /wp:paragraph –>
<!– wp:heading {“level”:3,”fontSize”:”medium”} –>
<h3 class=”wp-block-heading has-medium-font-size”>Types of page faults</h3>
<!– /wp:heading –>
<!– wp:list –>
<ul class=”wp-block-list”><!– wp:list-item –>
<li><strong>Minor page fault</strong>: the requested page exists on disk and in the system cache; it only needs to be mapped into the process’s address space.</li>
<!– /wp:list-item –>
<!– wp:list-item –>
<li><strong>Major page fault</strong>: the page is not in RAM or in any cache, and must be loaded from swap space or disk, which takes more time.</li>
<!– /wp:list-item –></ul>
<!– /wp:list –>
<!– wp:heading {“level”:3,”fontSize”:”medium”} –>
<h3 class=”wp-block-heading has-medium-font-size”>Example</h3>
<!– /wp:heading –>
<!– wp:list –>
<ul class=”wp-block-list”><!– wp:list-item –>
<li>A process tries to access a variable stored in a page that is not loaded in RAM.</li>
<!– /wp:list-item –>
<!– wp:list-item –>
<li>The operating system triggers a <strong>page fault</strong>, locates the page on disk, and loads it into RAM.</li>
<!– /wp:list-item –>
<!– wp:list-item –>
<li>The process continues execution without being aware of the swap operation.</li>
<!– /wp:list-item –></ul>
<!– /wp:list –>
<!– wp:separator {“className”:”is-style-wide”} –>
<hr class=”wp-block-separator has-alpha-channel-opacity is-style-wide”/>
<!– /wp:separator –>
<!– wp:heading {“level”:3} –>
<h3 class=”wp-block-heading”>See also</h3>
<!– /wp:heading –>
<!– wp:list –>
<ul class=”wp-block-list”><!– wp:list-item –>
<li>[Virtual memory]</li>
<!– /wp:list-item –>
<!– wp:list-item –>
<li>[Page (virtual memory)]</li>
<!– /wp:list-item –>
<!– wp:list-item –>
<li>[Block (storage)]</li>
<!– /wp:list-item –>
<!– wp:list-item –>
<li>[Buffer]</li>
<!– /wp:list-item –></ul>
<!– /wp:list –>
« Back to Glossary Index