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
is the operating system windows sometimes interupts

Explain FIFO page replacement A FIFO replacement algorithm associates with every page the time when that page was brought into memory. When a page must be changed, the oldest p

Can a direct access file be read sequentially? Explain. Yes. Keep a counter, cp, initially set to 0. After reading record cp, increment cp.

Objective - Tiny Shell (tish) In this exercise you will write a small shell program to run different programs in foreground and background mode. Background Usually when

Problem: Managing Outside Communication. a. What is the principal action we use when communicating through a web browser? b. Give an example of how to preaddress an email

What is a buddy system? We are dividing the memory as powers of two therefore the division will be 2, 4, 8, 16, 32, 64, 128, 256...i.e. in powers of 2 as well as we are selecti

Develop a user mode command interpreter which support these functions: "list-short" -- just like ls without any options "list-long" -- same as ls -l "change" -- same as cd Your co

List the Coffman's conditions that lead to a deadlock. Mutual Exclusion : Only one process might be use a critical resource at a time. Hold & Wait: A process may be alloc

Explain system-wide open-file and per-process open-file The system-wide open-file table have a copy of the FCB of each open file, as well as other information. The per-pr

When a computer is started on, the program that executed first is named the ''operating system.'' It controls pretty much all applications in the computer. This adds who logs in, h