Search Header Logo
[CSig] Virtual Memory

[CSig] Virtual Memory

Assessment

Presentation

Computers

9th - 12th Grade

Practice Problem

Easy

Created by

Andy tsui

Used 9+ times

FREE Resource

16 Slides • 6 Questions

1

[CSig] Virtual Memory

By Andy tsui

2

media
media

3

Objectives

  • Describe what is meant by virtual memory, how it is created and used and why it is necessary

  • Pages of data are transferred between RAM and virtual memory when needed​

Subject | Subject

Some text here about the topic of discussion

4

Multiple Choice

What does 'volatile' mean for a computer's memory?

1

Data and instructions remain stored even when the computer is switched off

2

Data and instructions may cause the computer to crash

3

Data and instructions are lost when the computer is switched off

5

Open Ended

What is the function of RAM?

6

Poll

How much RAM do your computer have?

4GB

8GB

16GB

32GB or more

7

media

8

Random access memory (RAM)

  • temporary storage for running application and data​

  • i.e. All applications need to move to RAM before start execution​​

Subject | Subject

Some text here about the topic of discussion

9

Open Ended

Pair discussion: What happen if we have too many opened application and ran out of RAM?

10

media

Virtual Memory

There's no problem in Computer Science that can't be solved by adding another layer of abstraction to it

11

Virtual memory

  • Using secondary storage to act as part of the main memory (RAM)

  • Prevent out of memory - crashing the system​

  • Managed by Operating System

  • Usually HDD / SSD will be used as virtual memory storage​

Subject | Subject

Some text here about the topic of discussion

12

Memory Address

  • In order to access (read/write) data on RAM, computer need to know "where" is the data

  • The smalles​t unit of data in RAM, is usually 1 Byte

  • Thus each Byte of data​ on RAM will have an address, for example, at 0x9000000E the data is 0x90 (hex 90)

Subject | Subject

media

13

PAGE

  • A PAGE is a group of continuous address in memory

  • Page is fixed-length in the computer system​

Subject | Subject

Some text here about the topic of discussion

14

media

Assume we give each apartment in a building a unique number​, counting from 1 ... number of apts.

We can use this number (address) to find a particular home.

But if we need to refer to a group of continuous number, then we can also give each floor a number, which will be "paging"

15

Multiple Select

Choose the correct ones

1

The smallest unit in computer memory to store is 1 Byte

2

Address in memory locates data

3

a Page is the smallest amount to store in RAM

4

a Page contains multiple addresses

5

Pages can have different sizes in a computer

16

how virtual memory works?

  • Operating system maintain a virtual mapping table

  • Application will request memory from OS, not directly to hardware

  • Application access the memory through Operating System

media

17

Cont'd

  • If there is enough RAM, OS will "map" the RAM address to virtual address

  • If there is not enough, OS will "map" address from HDD to the virtual address

  • Since application access memory through OS, it has no idea whether it is from RAM or HDD

media

18

Cont'd

  • But HDD is very slow compare to RAM (10-100 times slower)

  • OS will try its best to keep most frequently used / recent data in RAM

  • ​Unused data or inactive application will be SWAPPED to HDD page by page

media

19

PAGING

  • Swapping is done page by page (blocks of memory)

  • Happens when there's not enough main memory

  • OS copies the least access page to HDD, and copy the newly requested page to RAM​

20

21

Disk thrashing

  • Very frequent swapping of virtual memory

  • ​Usually due to very high usage of RAM​

Subject | Subject

Some text here about the topic of discussion

22

Open Ended

Discuss: What will be the consequences in case of disk thrashing?

[CSig] Virtual Memory

By Andy tsui

Show answer

Auto Play

Slide 1 / 22

SLIDE