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

Describe what is meant by client-server computing, Question 1: (a) Desc...

Question 1: (a) Describe what is meant by Client-server Computing? (b) Distinguish between a server process and a client process. (c) What are the basic characteristics o

Differences between foreground and background, Describe the differences bet...

Describe the differences between foreground and background processing. What advantage does background processing provide? 1. Background processes typically run with little or no

Define lru page replacement algorithm, Define LRU Page Replacement Algorith...

Define LRU Page Replacement Algorithm LRU policy: LRU expands to least currently use. This policy suggests which we re- move a page whose last usage is farthest from current ti

What is the hardware support required to implement paging, What is the hard...

What is the hardware support required to implement paging? Each operating system has its own techniques for storing page tables. The majority allocates a page table for each pr

System bus and device speeds as the cpu speed increases, Q. Why is it impor...

Q. Why is it important to scale up system bus and device speeds as the CPU speed increases? Answer: Consider a system which carries out 50% I/O and 50% computes. Doubling-up

Explain debugging a multi threaded program, Debugging a multi threaded prog...

Debugging a multi threaded program The following list points out few of the more frequent oversights and errors that can cause bugs in multithreaded programs. 1.    Ephemeral

Networking sockets with the use of shared memory, Q. Compare the utilizatio...

Q. Compare the utilization of networking sockets with the use of shared memory as a mechanism for communicating data between processes on a single computer. What are the merits of

Explain threads for executing concurrent application code, Explain Threads ...

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

Os installation, Question: OS Installation / File system a) Why is NTFS...

Question: OS Installation / File system a) Why is NTFS portioning preferred over FAT16 or FAT32 when security is of primary concern? b) State a situation or an application w

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