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

Mention some attractive properties of semaphore?, Mention some attractive p...

Mention some attractive properties of semaphore?              The Semaphores aren't provided by hardware. However they have numerous attractive properties: Machine indep

Define the throughput of a system, Define the “Throughput” of a system  ...

Define the “Throughput” of a system  Throughput is Number of programs processed by it per unit time

Linux, write a linux command to display lines from 25 - 45 of directory "/e...

write a linux command to display lines from 25 - 45 of directory "/edc/password" write a linux command to display directory in /edc

Define cpu scheduling, Define CPU scheduling. CPU scheduling is the met...

Define CPU scheduling. CPU scheduling is the method of switching the CPU among several processes. CPU scheduling is the basis of multiprogrammed operating systems. By switching

Networking and distributed systems, Networks and operating systems have a l...

Networks and operating systems have a lot of overlap. In this course, however,we are not going to discuss networking in detail, but rather focus on the networking abstractions prov

Explain the tlssetvalue (tlsindex, Explain the TlsSetValue (TLSindex, dataP...

Explain the TlsSetValue (TLSindex, dataPtr)Function The TlsSetValue function  associates the  dataPtr passed as a parameter as local storage for the requesting thread. The asso

Deadlock detection, Deadlocks can be detected while the program is running,...

Deadlocks can be detected while the program is running, by running cycle detection algorithms on the graph that de?nes the current use of resources. De?ne this graph as follows:

Write a short note about schedulers, Write a short note about schedulers. ...

Write a short note about schedulers. Processes migrate between the various scheduling queues throughout its life time. The operating system should select for scheduling purpose

#title. operation research, What are the features of Operation Research app...

What are the features of Operation Research approach?

Explain many-to-one model (green threads), Many-to-One Model (Green Threads...

Many-to-One Model (Green Threads) Implementations of the many-to-one model a lot of user threads to one kernel thread permit the application to create any number of threads tha

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