14
Advanced Operating system ECE 519 MEMORY MANAGMENT Baraa Saad Abdulhakeem Master Student-ECE

MEMORY MANAGMENT - Hasan H. BALIK · MEMORY MANAGMENT is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: MEMORY MANAGMENT - Hasan H. BALIK · MEMORY MANAGMENT is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs

Advanced Operating system ECE 519

MEMORY MANAGMENTBaraa Saad Abdulhakeem

Master Student-ECE

Page 2: MEMORY MANAGMENT - Hasan H. BALIK · MEMORY MANAGMENT is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs

TOPICS O

ve

rvie

w

What is Solaris OS? Objectives & Function

Me

mo

ry M

anag

em

en

t

What is MMU

what are tasks of MMU

what is virtual memory

What is paging

What is swapping

what is demand paging

How to use memory

for each application

MMU : Memory Management Unit

Page 3: MEMORY MANAGMENT - Hasan H. BALIK · MEMORY MANAGMENT is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs

• SOLARIS IS A UNIX-BRANDED OPERATING SYSTEM

• DEVELOPED BY SUN MICROSYSTEMS

What is Solaris OS

OS

Solaris

Multi - tasking

Security

User interface

Peripheral

Management

Memory

Management

Page 4: MEMORY MANAGMENT - Hasan H. BALIK · MEMORY MANAGMENT is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs

MEMORY MANAGMENTis the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs to optimize overall system performance. Memory management resides in hardware, in the OS (operating system), and in programs and applications , and It is a term used to describe

how the OS handles the available Memory ..

The memory management provides:

Large Address Spaces

Memory Mapping Protection

Fair Physical Memory Allocation Shared Virtual Memory

Page 5: MEMORY MANAGMENT - Hasan H. BALIK · MEMORY MANAGMENT is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs

Memory Management Techniques

Virtual Memory

Paging SwappingDemand paging

Page 6: MEMORY MANAGMENT - Hasan H. BALIK · MEMORY MANAGMENT is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs

3- It checks how much memory should be allocated to processes

1- Manage virtual-to-physical mappings

2- Manage physical memory.

4 - Provide isolation between processes.

Tasks of Memory Management

Virtual Memory Physical memoryMMU

MappingMapping

App1

App2

App2

App1

App2

App1

App..

5- It decides which process will get memory at what time

Page 7: MEMORY MANAGMENT - Hasan H. BALIK · MEMORY MANAGMENT is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs

Virtual Memory “ Any Problem in computer science can be solved by adding indirection .”

Virtual Memory takes program addresses and maps them to RAM addresses

Program Address Space (4GB)

RAMAddress space (1GB)

MAP

Program Address Space (4GB)

RAMAddress space (1GB)

0

1

2

??

0

1

2

NO VM : Crash if

we try to access

more RAM than

we have

VM :Mapping gives

us flexibility in how

we use the RAM

0

1 1

0

22

3

Page 8: MEMORY MANAGMENT - Hasan H. BALIK · MEMORY MANAGMENT is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs

PAGINGA technique used by virtual memory is divide up the virtual memory into pages and divides physical into frames

Map from virtual addresses to physical locations

Page 1

Page 2

Page 3

Page 4

Virtual

Addresses

FRAM1

FRAM2

FRAM3

FRAM4

Physical

Addresses

“Physical Location” may

include hard-disk

Page Table implements

this VP mapping

Page 9: MEMORY MANAGMENT - Hasan H. BALIK · MEMORY MANAGMENT is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs

Solaris

Virtual Memory

App1

App2

App3

Page physical

memory

Page Virtual

memory

Physical memory

APP2

APP 3

App1

How to use memory for each application

MMU

Page 10: MEMORY MANAGMENT - Hasan H. BALIK · MEMORY MANAGMENT is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs

SWAPPING

Process

P1

Process

P2Swap in

Swap out

Secondary

memory Main

memory

A process swapped temporary between memory and secondary memory a

specific program in memory is replaced by another program on secondary

memory to be inserted into the memory and executed.

Page 11: MEMORY MANAGMENT - Hasan H. BALIK · MEMORY MANAGMENT is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs

DEMAND PAGING• Is one of the methods used in the philosophy of virtual

memory

•Used to move pages from secondary memory to main memory

when requested

• Similar to the switch but the difference that moves here is not

the whole process only the pages required from that process

• This process allows to store more processes on the system

Page 12: MEMORY MANAGMENT - Hasan H. BALIK · MEMORY MANAGMENT is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs

Book:Solaris Internals, Core Kernel Architecture, Sun https://en.Wikipedia.org/wiki/solaris

Website:

www.sun.com https://en.wikipedia.org/wiki/Memory_management https://www.youtube.com/watch?v=_CruQY55HOk

References

Internet

Page 13: MEMORY MANAGMENT - Hasan H. BALIK · MEMORY MANAGMENT is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs
Page 14: MEMORY MANAGMENT - Hasan H. BALIK · MEMORY MANAGMENT is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs

Thank you

Have a Peaceful Night