csc 350 operating systems
Download
Skip this Video
Download Presentation
CSC 350 - Operating Systems

Loading in 2 Seconds...

play fullscreen
1 / 40

CSC 350 - Operating Systems - PowerPoint PPT Presentation


  • 163 Views
  • Uploaded on

CSC 350 - Operating Systems. CSC 350 - Operating Systems. CSC 350 - Operating Systems. Creeds or Chaos?. Memory Management I. II. Memory Management I. manage the scarce resource of memory. Memory Management I. C. Dynamic partitions MMS . Partitions are created dynamically “on the fly”.

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

PowerPoint Slideshow about 'CSC 350 - Operating Systems' - chloe


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
memory management i
Memory Management I

II. Memory Management I

  • manage the scarce resource of memory
memory management i1
Memory Management I

C. Dynamic partitions MMS

  • Partitions are created dynamically “on the fly”
memory management i2
Memory Management I

3. OS concept - allocation

  • programs must be assigned to memory
  • note: if not enough contiguous RAM, program must wait
memory management i3
Memory Management I
  • programs must be assigned to memory
  • how? (tradeoffs)
memory management i4
Memory Management I

a. first-fit

  • the first (lowest) partition big enough for the program will be allocated
memory management i5
Memory Management I

a. first-fit

  • adv: fast allocation
memory management i6
Memory Management I

b. best-fit

  • the best (causing least fragmentation) partition will be allocated
memory management i7
Memory Management I

b. best-fit

  • adv: best utilization
memory management i8
Memory Management I

3. OS concept - allocation

  • tables 2.2 and 2.3
memory management i9
Memory Management I

3. OS concept - allocation

  • suitcase analogy
memory management i10
Memory Management I

3. OS concept - allocation

example problem 4, p.39

  • Job / Program size
  • Block / Partition size
memory management i11
Memory Management I

Memory “map”

Jobs = programs on storage

block 1

block 2

block 3

610K

850K

J1 = 740K

J2 = 500K

J3 = 700K

700K

memory management i12
Memory Management I

Memory “map”

a. best fit

block 1

block 2

block 3

J2 = 500K

610K

J1 = 740K

850K

J3 = 700K

700K

memory management i13
Memory Management I

Memory “map”

b. first fit

low - highsearch

block 1

block 2

block 3

J2 = 500K

610K

J1 = 740K

850K

J3 = 700K

700K

memory management i14
Memory Management I

Memory “map”

b. first fit

high-low search

block 1

block 2

block 3

610K

J1 = 740K

850K

J2 = 500K

700K

J3 = 700K wait

memory management i15
Memory Management I

3. OS concept - allocation

  • group exercise :-)modified problem 4, p.39
memory management i16
Memory Management I
  • modified problem 4, p.39
  • Job Size Block Size
  • 1 740K 1 610K
  • 2 500K 2 850K
  • 3 600K 3 500K
memory management i17
Memory Management I

3. OS concept - allocation

  • anotheranalogy
memory management i18
Memory Management I

4. OS - deallocation

  • programs must be removed from memory when finished
memory management i19
Memory Management I

4. OS - deallocation

easy for fixed partitions

  • more difficult for dynamic partitions
memory management i20
Memory Management I

scenarios:

  • a. deallocated memory is not adjacent to free memory
memory management i21
Memory Management I
  • a. deallocated memory is not adjacent to free memory

allocated

To be deallocated

allocated

memory management i22
Memory Management I

4. OS - deallocation

  • scenarios:
  • b. deallocated memory is adjacent to one free memory partition
memory management i23
Memory Management I
  • b. deallocated memory is adjacent to one free memory

free

To be deallocated

allocated

memory management i24
Memory Management I

4. OS - deallocation

  • scenarios:
  • c. deallocated memory is between two free memory partitions
memory management i25
Memory Management I
  • c. deallocated memory is between two free memory blocks

free

To be deallocated

free

memory management i26
Memory Management I

D. Relocatable Dynamic partitions MMS

  • 1. Based upon Dynamic Partitions MMS with additional feature
memory management i27
Memory Management I

Based upon Dynamic Partitions MMS with additional feature

  • At times, OS will “compact” memory
memory management i28
Memory Management I

Red = allocated partitions

Green = free space (unallocated RAM)

memory management i30
Memory Management I

2. Tradeoffs

  • a. advantages
  • b. disadvantages
memory management i31
Memory Management I

review CS:AO sections 2.2 and 2.3

memory management i32
Memory Management I

3. OS needs h/w assistance

  • bounds register
  • relocation register
memory management i33
Memory Management I

B1 = 20K

B2 = 10K

B3 = 30K

Prog K

Prog B

Prog S

now,

Program B terminates,

memory management i34
Memory Management I

B1 = 20K

B2 = 10K

B3 = 30K

Prog K

Prog S

now,

Program Bterminates,OS deallocates Partition 2

memory management i35
Memory Management I

B1 = 20K

B2 = 30K

Prog K

Prog S

now,

Program Bterminates,OS deallocates Partition 2 and compacts (relocates)

memory management i36
Memory Management I

B1 = 20K

B2 = 30K

Prog K

Prog S

Prog S

Bounds Register = 30K

Relocation Register = -10K

ad