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

Define semaphore, Define semaphore A semaphore is a protected abstract ...

Define semaphore A semaphore is a protected abstract or variable data type that constitutes the classic method for restricting access to shared resources like shared memory in

Estimate the continued transfer rate of drive, Q. The term "fast wide SCSI...

Q. The term "fast wide SCSI-II" signifies a SCSI bus that operates at a data rate of 20 megabytes per second when it moves a packet of bytes among the host and a device. Presume t

What is belady anomaly, What is Belady's anomaly When plotting on a g...

What is Belady's anomaly When plotting on a graph the page faults versus the number of available frames. We notice that the number of faults for four frames is greater than th

Suggest a scheme for implementing this policy, Q. Consider a calculating e...

Q. Consider a calculating environment where a process is given the privilege of accessing object only n times. Suggest a scheme for implementing this policy. Answer: Add an i

Why do systems stay track of the type of a file, Q. Why do some systems sta...

Q. Why do some systems stay track of the type of a file while others leave it to the user or simply don't implement multiple file types? Which system is "better?" Answer: A f

Backup and recovery, what is it all about? why do we need? what are the typ...

what is it all about? why do we need? what are the types of backup? how is it done in unix?

Implementing group policies in a windows environment, Question: (a) As...

Question: (a) As a System administrator, elaborate on how you can manage computer accounts in Active Directory of Windows Server 2008? (b) Explain the following user p

Memory management, example of first fit best fit and worst fit

example of first fit best fit and worst fit

Explain about disk scheduling with neat diagram, Explain about disk schedul...

Explain about disk scheduling with neat diagram? FCFS Scheduling SCAN scheduling C-SCAN scheduling SSTF scheduling LOOK Scheduling

Define logical address and physical address, Define logical address and phy...

Define logical address and physical address. An address formed by the CPU is referred as logical address. An address seen by the memory unit that is the single loaded into the

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