virtual memory n.
Skip this Video
Download Presentation

Loading in 2 Seconds...

play fullscreen
1 / 23

VIRTUAL MEMORY - PowerPoint PPT Presentation

  • Uploaded on

VIRTUAL MEMORY. By Thi Nguyen. Motivation. In early time, the main memory was not large enough to store and execute complex program as higher level languages became popular. In 1961, virtual memory was proposed to solve the problem of storage allocation. Definition.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'VIRTUAL MEMORY' - cooper-jarvis

Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
virtual memory



Thi Nguyen

  • In early time, the main memory was not large enough to store and execute complex program as higher level languages became popular.
  • In 1961, virtual memory was proposed to solve the problem of storage allocation.
  • Virtual memory is a memory management system that gives a computer the appearance of having more main memory than it really has.
  • Main memory is used more efficiently. Only those portions of an executing program that are in use occupy main memory.
  • Programs that are bigger than main memory can still be executed
implementation of virtual memory
Implementation of Virtual Memory
  • The virtual memory abstraction is implemented by using secondary storage to augment the processor's main memory.
  • Data is transferred from secondary to main storage when necessary and the data replaced is written back to the secondary storage.
implementation of virtual memory1
Implementation of Virtual Memory
  • If the data swapped is designated a fixed size, this swapping is called paging.
  • if variable sizes are permitted and the data is split along logical lines, it is called segmentation.
  • Some operating systems combine segmentation and paging.
  • In a simple paging system view,
    • user programs consists of fixed-length blocks called pages.
    • Main memory consists of fixed-length blocks called frames.
  • When an operating system loads a user program into memory, it loads each page into any available frame.
page table
Page Table
  • To keep track of the location of each page in the memory, the operating system builds a one-dimensional array called Page Table.
  • The mapper is the part of the operating system that translates the logical page number generated by the program into the physical page frame number where the main memory holds the page.
  • This translation is accomplished by using page table. If the page table reveals that the page is not resident in the main memory, the mapper issues a page fault to the operating system so that execution is suspended on the process until the desired page can be read in from the secondary storage and placed in main memory.
page in
Page in
  • The corresponding operation of reading them in again later when one of the pages is referenced is called a page in.
page out
Page out
  • The operation of writing one inactive page, or a cluster of inactive memory pages to disk is called a page out.
  • Paging is effective because programs typically only use a small proportion of their virtual memory pages actively at any one a time.
  • Allows a program that is too big to fit into memory to be executed
  • Once the memory is allocated for modules they cannot vary in size. This restriction results in either wastage or shortage of memory.
  • In paging system, stack is put at the top of its logical address space; data and code are put at the bottom. The gap between them requires a page table that is too big.
  • the program is divided into functional segments such as code segment, stack segment, data segment…
  • some computer systems have their main memory divided into many independent address spaces. Each of these address spaces is called a segment. The address of each segment begins with 0 and segments may be compiled separately.
  • Each segment in the program can be transferred into segments in main memory. However, it may happen that the program segment is too big to fit in main memory segment.
segmentation with paging
Segmentation with Paging
  • Some operating systems allow for the combination of segmentation with paging. If the size of a segment exceeds the size of main memory, the segment may be divided into equal size pages.
segmentation with paging1
Segmentation with Paging
  • Each segment has its own page table.
  • The used gap in the address space would not be represented by any page table.
virtual address
Virtual Address
  • The address consists of three parts:
    • (1) segment number
    • (2) the page within the segment
    • (3) the offset within the page.
  • The segment number is used to find the segment descriptor and the address within the segment is used to find the page frame and the offset within that page.
comparison between paging and segmentation

Involves programmer

Separate compiling

Separate protection

Shared code


Transparent to programmer

No separate compiling

No separate protection

No shared code

Comparison between Paging and Segmentation