100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Summary notes on. memory management

Rating
-
Sold
-
Pages
17
Uploaded on
27-07-2023
Written in
2022/2023

a detailed summary of memory management topic in the OSC module











Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
July 27, 2023
Number of pages
17
Written in
2022/2023
Type
Summary

Content preview

Memory Management : Background

- Memory : one linear array of bytes
- Memory hierarchies
- Registers
- L1/L2/L3 cache
- Disks
- Main memory (RAM)
- Higher Memory : Faster, More Expensive and Volatile
- Lower Memory : Slower, Cheaper and Non-Volatile

- Volatile : if power is lost then all the contents are gone

- OS Responsibilities (in Managing Memory)
- Allocate/Deallocate memory when requested by processes
- Keep track of used/unused memory
- Distribute memory between processes
- Control access (only if system is multi-programmed)
- Move data from memory to disk and back

Partitioning

- Contiguous : block of memory allocated to a process (without breaks)
- Non-Contiguous : blocks of memory allocated to a process (anywhere in main memory)

Approaches to Partitioning : Contiguous


Mono-Programming Multiprogramming Multiprogramming
(Fixed Partitions) (F. Non-Equal Partition)

About Single user process at a Fixed equal size partitions Fixed non-equal size
time partitions
Divide memory in static,
Fixed region of memory contiguous and equal size
allocated to OS/kernel partitions

Remaining memory for a Processes can take large
single process enough partition

Process has direct access Allocation of fixed equal
to physical memory size partitions (simple,
little overhead)
Common in consumer
electronics (E.g, washing OS keeps track of which
machine) partition is used/free

, Good No address translation Little overhead Reduces internal
needed fragmentation
Allocation is easy (=>
Contains no holes and gaps simple implementation)

One process has whole
memory space

Overlays (enable
programmer to user more
memory than available)

Bad Direct access to physical Low memory utilization Allocation of partitions
memory (may have access (internal fragmentation: need to be carefully
to OS memory) partition is too large) considered

OS is a process (have 2 overlays used to manage
process anyway) memory (burden on the
programmer)
Underutilisation of hardware

Not good on modern
machines




Approaches to Partitioning : Detour (Probabilistic Model to Simulate Multiprogramming)


Variable(s) / Assumption(s) N : process in memory
p : time spent by the process to wait for I/O
cUtil : 1 - p
p^n : probability of N process waiting for I/O
cUtil : 1 - p^n

Assumes that all processes are independent
of each other.

Sample Calculation Assume
- Computer has 1 MB of memory
- OS takes up 200KB of memory
- I/O wait time of 80% (0.8)

Based on assumptions 1 and 2
- Space for 4 200KB processes left

cUtil = 1 - (0.8)^4 = 0.5904 ( ~ 60%)

, Assume
- Another 1MB added to memory

Based on Assumption 4
- Space for 5 more 200KB processes

cUtil = 1 - (0.8)^9 = 0.865 (~ 87%)

Assume
- Another 1MB added to memory

Based on Assumption 5
- Space for 5 more 200KB processes
- Totally 5 + 5 + 4 = 14 processes

cUtil = 1 - (0.8)^14 = 0.956 (~ 96%)

Observation(s) CPU Utilisation
- Increases with no of processes
- Decreases with level of I/O

Other Notes When a system is multiprogrammed and
more memory is added then the cpu
utilization increases

This model can be used to approximate but
more complex models built using queueing
theory


Memory Allocation Model


Private Queue per Partition Single Queue for all Partitions

Each process is assigned the smallest Allocate small processes to larger partitions
partition it would fit in
Can result in increase internal fragmentation
Reduces internal fragmentation

Reduces memory utilization (can also result
in starvation : small jobs in unused larger
partitions)
£14.49
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
rahulravi1

Get to know the seller

Seller avatar
rahulravi1 The University of Nottingham
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
2 year
Number of followers
0
Documents
4
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions