Typical virtual memory layout, Operating System

Assignment Help:

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.


Related Discussions:- Typical virtual memory layout

Explain terminal symbols, Explain Terminal Symbols Terminal symbols are...

Explain Terminal Symbols Terminal symbols are literal strings that are forming the input of a formal grammar and cannot be broken down into smaller units with no losing their l

Operating system design, You are required to study the important system com...

You are required to study the important system components, including important data structures, important functions and algorithms, and the various organizational, structural, logi

Define server processing with queues, Define Server Processing with Queues ...

Define Server Processing with Queues The efficient server processing of client request is essential for optimized client- server applications. This process is greatly enhanced

What are the three main purposes of an operating system, What are the three...

What are the three main purposes of an operating system? _ To give an environment for a computer user to implement programs on computer hardware in a convenient and efficient m

Explain the circumstances under which os use mutexes, Q. Give the reasons ...

Q. Give the reasons why Windows XP, Solaris and Linux implement multiple locking mechanisms. Explain the circumstances under which they use mutexes, spinlocks, semaphores, adaptiv

Unix and linux commands, To explore the UNIX file system, use basic UNIX co...

To explore the UNIX file system, use basic UNIX commands and use a text editor. Task:   1.      Logon to Linux. 2.      Create a directory "Unix" under your home d

State in a deadlock-avoidance system, Question: In a deadlock, processe...

Question: In a deadlock, processes never finish executing and system resources are tied up, preventing other jobs from starting. Deadlocks can be characterised by a set of cond

Explain about spooling, Q. Explain about Spooling? Acronym for simu...

Q. Explain about Spooling? Acronym for simultaneous peripheral operations on line. Spooling denotes to putting jobs in a buffer, a special area in memory or on a disk where

What do you mean by reference counts, Q. If each the access rights to an o...

Q. If each the access rights to an object are deleted the object can no longer be accessed. At this stage the object should also be deleted and the space it occupies should be ret

What is cold backup, Cold Backup: It is copying the three groups of files...

Cold Backup: It is copying the three groups of files when the object is shut down. This is a straight file copy, generally from the storage disk directly to tape. You must end th

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd