How Virtual Memory Works?

  • Each programs has its on virtual address space and Map(Translator). Map maps to the physical address either in RAM or Disk.
  • When address is mapped in Disk, it is first loaded to RAM, also mapping table is updated and then data is loaded.
  • This Map is called Page Table and the entry in it is called Page Table Entry.
    • Well, if, for each virtual address an entry is used, the size of Page Table alone would be large. Also, note that for each program we have a Page Table.
    • So, each entry instead of handling each V. address, handles chunk of V. addresses(range) and maps that to chunk of P. addresses(range).
    • The point above resolves the problem of large memory usage.
    • We typically have 4kB of pages(1024 words).
    • Bigger the page size, moving from the disk would take more time. Lesser the page size, more memory is needed to store page table.
  • A V. address is divided in V. Page number and Page offset. V. Page number is mapped to P. page address and page offset just concatenates with it.Screenshot from 2016-06-22 22-13-50

Help to improve or comment as you wish

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s