download

Matakuliah
Tahun
Versi/Revisi
: T0316/sistem Operasi
: 2005
:5
Pertemuan 11
Manajemen Memori
OFFCLASS02
1
Learning Outcomes
Pada akhir pertemuan ini, diharapkan mahasiswa
akan mampu :
• menjelaskan pengelolaan memory dan analisa
kinerja multiprogramming (C2)
2
Outline Materi
•
•
•
•
•
•
Teknik dasar pengaturan memory
Monoprogramming
Multi programming dgn Partisi tetap
Modeling Multiprogramming
Analysis kinerja sistem multiprogramming
Relokasi dan proteksi
3
Memory Management
• Ideally programmers want memory that is
– large
– fast
– non volatile
• Memory hierarchy
– small amount of fast, expensive memory – cache
– some medium-speed, medium price main memory
– gigabytes of slow, cheap disk storage
• Memory manager handles the memory
hierarchy
4
Basic Memory Management
Monoprogramming without Swapping or Paging
Three simple ways of organizing memory
- an operating system with one user process
5
Multiprogramming with Fixed Partitions
• Fixed memory partitions
– separate input queues for each partition
– single input queue
6
Multiprogramming with Fixed Partitions
• Multiple input queue
– When a job arrives, it can be put into the input queue for the
smallest partition large enough to hold it
• Any space in a partition not used by a job is lost
• The queue for a large partition is empty but the queue for a
small partition is full
• Single input queue
– Whenever a partition becomes free, the job closest to the
front of the queue that fits in it could be loaded
• May waste a large partition on a small job
– Alternatively  search the whole input queue whenever a
partition becomes free and pick the largest job that fits
• Discriminates against small jobs, whereas the smallest job shall
get the best service
• Solution:
– Have at least small partition around
– A job may not be skipped for k times
7
Modeling Multiprogramming
1-pn
Degree of multiprogramming
CPU utilization as a function of number of processes in memory
8
Analysis of Multiprogramming System Performance
• Arrival and work requirements of 4 jobs
• CPU utilization for 1 – 4 jobs with 80% I/O wait
• Sequence of events as jobs arrive and finish
– note numbers show amout of CPU time jobs get in each interval
9
Relocation and Protection
• Cannot be sure where program will be loaded
in memory
– address locations of variables, code routines
cannot be absolute
– must keep a program out of other processes’
partitions
• Use base and limit values
– address locations added to base value to map to
physical addr
– address locations larger than limit value is an error
10