<!– wp:paragraph –>
<p><strong>Virtual memory</strong> is a mechanism that allows an operating system to manage memory so that each process has the illusion of its own continuous memory space, independent of the actual physical hardware (RAM).</p>
<!– /wp:paragraph –>
<!– wp:paragraph –>
<p>In practice, virtual memory is based on a system of <strong>logical addressing</strong> that is translated into physical addresses through a page table and a <em>Memory Management Unit</em> (MMU). This allows processes to use more memory than what is physically available, since part of the content can be stored on the <strong>disk</strong> in swap or paging files.</p>
<!– /wp:paragraph –>
<!– wp:heading {“level”:3,”fontSize”:”medium”} –>
<h3 class=”wp-block-heading has-medium-font-size”>Key characteristics</h3>
<!– /wp:heading –>
<!– wp:list –>
<ul class=”wp-block-list”><!– wp:list-item –>
<li><strong>Illusion of continuous space</strong>: each process believes it has its own linear and independent memory.</li>
<!– /wp:list-item –>
<!– wp:list-item –>
<li><strong>Paging</strong>: memory is divided into <a href=”/glossary/page-virtual-memory”><strong>pages</strong></a> of fixed size (e.g., 4 KB), which can be loaded or unloaded from RAM to disk as needed.</li>
<!– /wp:list-item –>
<!– wp:list-item –>
<li><strong>Isolation</strong>: processes cannot directly access each other’s memory, improving security and system stability.</li>
<!– /wp:list-item –>
<!– wp:list-item –>
<li><strong>Efficient management</strong>: enables execution of programs larger than the available physical RAM and optimizes resource usage.</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 requires 6 GB of memory, but the machine only has 4 GB of RAM.</li>
<!– /wp:list-item –>
<!– wp:list-item –>
<li>The operating system keeps the most frequently used pages in RAM and moves the rest to the <em>swap</em> space on disk.</li>
<!– /wp:list-item –>
<!– wp:list-item –>
<li>When the process needs a page that is not in RAM, a <a href=”/glossary/page-fault”><strong>page fault</strong></a> occurs and the OS automatically loads it from disk.</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>[Page (virtual memory)]</li>
<!– /wp:list-item –>
<!– wp:list-item –>
<li>[Block (storage)]</li>
<!– /wp:list-item –>
<!– wp:list-item –>
<li>[Page fault]</li>
<!– /wp:list-item –>
<!– wp:list-item –>
<li>[Buffer]</li>
<!– /wp:list-item –></ul>
<!– /wp:list –>
« Back to Glossary Index