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
Determine a parser which is a variant of top-down parsing without backtracking Recursive Descend parser is a variant of top-down parsing without backtracking.

What are the main differences between operating systems for mainframe computers and personal computers? The design goals of operating systems for those machines are quite diffe

The Cigarette-Smokers difficulty Consider a system with three smoker processes and one agent process. Every smoker continuously rolls a cigarette and then smokes it. But to roll as

Medium term scheduling This is component of the swapping function. Usually the swapping in decision is based on the need to manage the degree of multiprogramming. At a system t


Q. Explain about Time Sharing Systems? Time Sharing Systems Multi-programmed batched systems provide an environment where various system resources (for illustration CP

The drawbacks of fixed partitioning are: The number of partitions are précised at system generation time limits the number of active processes in the system. For the re

Q. Explain some of the ways an application can use memory via the Win32 API. Answer: (1) Virtual memory offers several functions that allow an application to reserve and rele

Q. Presume that a distributed system is susceptible to server failure. What mechanisms would be needed to guarantee the exactly once semantics for execution of RPCs? Ans

Define Disadvantages of Top Down parsing of Backtracking The disadvantages of top down parsing of backtracking: (i)  Semantic actions cannot be carried out while making a pr