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
Explain Processing Predefined Application Protocols Implementing and swift processing of predefined application protocols is sure to improve performance of server - side applic

Concept of Reentrancy   It is a useful, memory-saving method for multiprogrammed timesharing machines. A Reentrant method is one in which multiple clients can share a singl

Problem: a) The CPU can access 2 storage devices directly. What are these 2 storage devices? b) Define 2 key issues involved in memory management. c) How do processes sha

What is the use of FIFOs in client-server applications

Why Global variables are unacceptable Global variable, for instance, are unacceptable because they break the rules of self - containment. If all procedural components are runni

A friend has promised to log in at a particular time. However, he needs to be contacted as soon as he logs in. The shell script checks after every minute whether he has logged in o

Transparency : Users must be able to access remote resources as though these resources were local. Transparency should as well promote user mobility. Users must be allowed to lo

Define thread cancellation & target thread. The thread cancellation is the task of terminating a thread before it has completed. A thread that is to be cancelled is often refer

The CTO is still impressed with your work. He just came back from a technology exposition where he heard about computer clusters. All he knows is that they are the big thing for bu

Buddy system of memory allocation Free memory is used to maintain in linked lists, each of similar sized blocks. Every block is of size 2^k. When some memory is needed by a th