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 the difference between internal and external fragmentation. Internal Fragmentation is the area in a region or a page that is not used by the job occupying that region o

wat are the commands used for creating the file hierarchy

Q. Consider the two-dimensional array A: int A[][] = new int[100][100]; Whereas A [0][0] is at location 200 in a paged memory system with pages of size 200. A little process

Suppose a logic-based agent in the wumpus world has found that locations (1,1) and (2,1) do not contain a stench, but that locations (3,1) and (2,2) do contain a stench. Can the ag

4. Describe priority scheduling algorithm. Consider the following set of processes. Show the order in which the algorithm will schedule these processes. Assume preemptive and non-p

Explain Threads for Executing Concurrent Application Code The thread has been introduced in many operating systems as an efficient mechanism for executing concurrent applicatio

The performance of a file system depends upon the cache hit rate (fraction of blocks found in the cache). If it takes 1 msec to satisfy a request from the cache, but 40 msec to sat

Define the properties of Interactive operating system Interactive:- This system is composed of many short transactions where the results of the next transaction may be unpred

In the mean while the fork() system call the Kernel creates a copy of the parent process's address space and adds it to the child process. But the vfork() system call do no

What is reference string We evaluate an algorithm by running it on a definite string of memory reference and computing the number of page faults. The string of memory reference