Typical virtual memory layout, Operating System

Using pages makes it easier to manage the whole memory, avoiding excessive fragmentation and waste. As an analogy, think of Tetris, but with only square blocks: it is relatively easy to avoid fragmentation in this case. Both the virtual and the physical memory are divided into pages. As an aside, we often refer to physical memory pages as frames. Every virtual page consists of a range of virtual addresses. Virtual pages are then mapped to physical pages in the physical memory. When an application needs to access a virtual page, the corresponding virtual address is translated into a "real" physical address, and then the actual data might be read and/or written. As a consequence, note that although arrays are contiguous in virtual memory, they may be non-contiguous in physical memory. Note also that some virtual pages do not map to any actual physical memory address, because not all virtual pages are necessarily being used at any given time. The unused virtual pages are called invalid. If a program ever tries to access an invalid page, it pagefaults.

A typical virtual memory layout includes a stack, a mmap region, a heap, and the code of the program (the "text" section). Since mmap and heap grow towards each other, in the worst case they could smash into each other. The same could happen with the stack: if a program recurses for a large number of times, the stack could grow over the mmap region ("stack over?ow") and in this case something bad and usually unpredictable will happen.

Posted Date: 3/12/2013 5:35:28 AM | Location : United States







Related Discussions:- Typical virtual memory layout, Assignment Help, Ask Question on Typical virtual memory layout, Get Answer, Expert's Help, Typical virtual memory layout Discussions

Write discussion on Typical virtual memory layout
Your posts are moderated
Related Questions
Q. Discuss the advantages as well as disadvantages of caching name translations for computers located in remote domains. Answer: There is a performance benefit to caching nam


What is the main function of the memory-management unit? The runtime mapping from virtual to physical addresses is done by a hardware device known as a memory management unit (

Optimal page replacement An optimal page replacement algorithm has the least page fault rate of all algorithms. The algorithm states that a 'replace the page that will not be

Explain the various methods for handling deadlocks.      A set of processes is deadlocked if every process in the set is waiting for an event that only a process in the

With software algorithms for mutual exclusion, such as Dekker's algorithm, Peterson's algorithm, or Lamport's bakery algorithm, note that optimizing compilers and out-of-order exec

What is Two-level directory In the two-level directory structure every user has own user file directory (UFD). When a user jobs begins or a user logs in, the system's master fi

Define the “Throughput” of a system  Throughput is Number of programs processed by it per unit time

advantage and dis advantage of threads

An operating system provides the environment within that programs are executed. Internally operating systems differ greatly in their makeup because they are organized along many di