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

What is the use of boot block? For a computer to begin running when powered up or rebooted it requires having an initial program to run. This bootstrap program tends to be easy

Q. List the four steps that are essential to run a program on a completely dedicated machine. Answer: a) Reserve machine time b) Manually load program into memory c)

Question : The file system is the most visible aspect of an operating system. It provides the mechanism for on-line storage and access to both data and programs of the operatin

Determining the time quantum for a job is a critical task. Given the assumptions that the average switching time between processes is s, and the average amount of time an I/O bo

Question: (a) Describe blocking and non-blocking types of inter-process communication. What is easier to implement and why? Discuss their relative advantages and disadvantage

The questions ask List four major functions of an OS. My answer: Function 1: Provide a user interface Function 2: Manage files Function 3: Manage hardware Function 4: Manage appli

Differentiate tightly coupled systems and loosely coupled systems? Loosely coupled systems:-  Every processor has its own local memory  Every processor can communicate

What are the deadlock p revention methodologies? a.       Necessitate that processes request all resources before starting - if cannot be granted don't run. b.      Process

what if we need the portion from a text based on some keyword. For eg. My file is like below, ------------------------------------------------ Order=[ 1 2 3 4 5 Order=[ 6 7 8 9