Presentation is loading. Please wait.

Presentation is loading. Please wait.

What is trying to solve any virtual memory implementation ?

Similar presentations


Presentation on theme: "What is trying to solve any virtual memory implementation ?"— Presentation transcript:

1 The agnostic explanation of Virtual Memory with Basic and Multi-level Page Tables

2 What is trying to solve any virtual memory implementation ?
* Not enough RAM * Holes in our address space (memory fragmentation) * Programs (or any similar entity with context) writing over each other How is a modern virtual memory implementation working? * Stores sundry indirection levels for getting fast page translation.

3 The Hypothetical 32 bit address space for a program
An Operative system or any other software artifact with a virtual memory implementation migth give each program its own 32 bits address space. Programs would access any byte within the range of 32 bits (4Gb) What if we did not have 4Gb of memory ?

4 How do programs share the memory space?

5 Memory Fragmentation (Holes in memory)
A program would need All its required memory In a row Now I could not run Program 3. Even I 've got enough Space in memory

6 How do we keep programs secure ?
* Each programs could access any 32 bit address :( * They would corrupt or crash each other (where is then security and reliability?)

7 What is a virtual memory implementation ?
ButlerLampson once said, "all problems in Computer Science can be solved by another level of indirection" Virtual memory is a layer of indirection. That maps program address and map them to the physical memory.

8 Mapping the memory with flexibility
* To try to load something beyond 1Gb will turn out in moving out some old pages to the disk memory and an updating of the map (a.k.a Page out).Then the earlier data will be load inside the new available spaces. *When we need it (this need is also know as page-fault), we bring it into memory. (a.k.a Page in).

9 Each program is mapped in the physical memory (without a need of contiguos memory)

10 Security and reliability problem is solved
In spite of isolation. This approach allows to shared data among programs when It is needed.

11 Map == Page Table

12 Pages instead of Words

13 The trade-off

14 From page Virtual to Physical

15 The offset A virtual address is compound of 2 parts * Page table address and offset

16 Address Translation for system with just 256MB of RAM

17 Which Page ?

18 Just a brief question to ensure everything is clear

19 An example of translation with more details for 4kb pages

20 An example of translation with more details for 64kb pages

21 Multi-level Page Tables
* Each Program need a Page table that will consume 4MB RAM Why 4MB ? * If we`ve got 100 programs running , we require 400MB just for page tables.

22 Multi-level Page Tables
* Each Program need a Page table that will consume 4MB RAM Why 4MB ? * If we`ve got 100 programs running , we require 400MB just for page tables.

23 How can we fix this ? I think we would add other indirection level for Saving memory.

24 Now We can have page tables in disk or memory
Multi level page table introduces a bit of hierarchy to reduce the amount of information needed at any one time.

25 1st Level page table is always in memory
* We always need 1st level page table in memory to find the second one levels * First level page table is only a helper to find the other page tables

26 An example of multilevel page table translation

27 Not used then Not Allocated
Regions which are not actually used do not require allocated memory (These will be mark in the outer page table). The multi-level scheme reduces the memory by requiring Page Tables only for those virtual memory regions actually used by a process.


Download ppt "What is trying to solve any virtual memory implementation ?"

Similar presentations


Ads by Google