SlideShare a Scribd company logo
Damian Gordon
HARD DISK
(MAIN
MEMORY)
(SECONDARY
MEMORY)
2
CACHE 1
HARD DISK
(MAIN
MEMORY)
(SECONDARY
MEMORY)
2
CACHE 1
HARD DISK
(MAIN
MEMORY)
(SECONDARY
MEMORY)
2
CACHE 1
101
Approximate number of clock cycles to access
the various elements of the memory hierarchy.
HARD DISK
(MAIN
MEMORY)
(SECONDARY
MEMORY)
2
CACHE 1
101
103
Approximate number of clock cycles to access
the various elements of the memory hierarchy.
HARD DISK
(MAIN
MEMORY)
(SECONDARY
MEMORY)
2
CACHE 1
101
103
107
Approximate number of clock cycles to access
the various elements of the memory hierarchy.
 Let’s consider an operating system model
with a single user, and how they use memory.
MAIN
MEMORY
200K
available
MAIN
MEMORY
 If I create a program:
200K
available
MAIN
MEMORY
 If I create a program:
PROGRAM 1
200K
available
MAIN
MEMORY
 If I create a program:
 to be processed, it has
to be written entirely into
Main Memory, in
contiguous space
PROGRAM 1
200K
available
MAIN
MEMORY
PROGRAM 1
200K
available
MAIN
MEMORY
 If the program is bigger:
PROGRAM 1
200K
available
MAIN
MEMORY
 If it doesn’t fit in the
memory, it’s can’t be
processed.
200K
available
MAIN
MEMORY
 This is the limitation of all computers, if a
program is too big, we have to do one of two
things:
1. Get more memory
2. Make the program smaller
Store first location of program in the base register
(for memory protection);
Set Program Counter to the first memory location;
Read first instruction of program;
WHILE (last instruction reached OR Program Counter is
greater than Memory Size)
DO Increment the Program Counter;
IF (last instruction reached)
THEN Stop Loading Program;
END IF;
IF (Program Counter is greater than Memory Size)
THEN Stop Loading Program;
END IF;
Load instruction into memory;
Read next instruction of program;
END WHILE;
 To allow more than one program to run at the
same time, the memory is subdivided into
FIXED PARTITIONS.
MAIN
MEMORY
250K
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
250K
100K
25K
25K
50K
50K
 This leaves us with less memory, but at least
more than one user (and their user process)
can be logged into the system at the same
time.
 If we want to adjust the size of the partitions
we need to shut down the system, go into the
boot login, and then restart.
WHILE (there are still programs in the queue)
DO Determine the program’s requested memory size;
IF program size > Size of Largest Partition
THEN Reject the program;
PRINT “program Rejected: Not Enough Memory”;
Exit; /* this iteration and get next program */
END IF;
MyCounter := 1;
WHILE (MyCounter <= Number of Partitions in Memory)
DO IF (program Size > Memory_Partition[Counter].Size
THEN MyCounter := MyCounter + 1;
ELSE IF (Memory_Partition[Counter].Status == “FREE”;
THEN Load program into Memory_Partition[Counter];
Memory_Partition[Counter].Status := “BUSY”;
Exit; /* this iteration and get next program */
ELSE MyCounter := MyCounter + 1;
END IF;
END WHILE;
No partition available;
put program in waiting queue;
END WHILE;
 To make this work, the Memory manager
needs to keep a Partition Table to remember
the status of all the partitions.
 To make this work, the Memory manager
needs to keep a Partition Table to remember
the status of all the partitions.
Partition
Number
Partition
Size
Memory
Address Access
Partition
Status
1 100K 200K Program1 BUSY
2 25K 300K Program4 BUSY
3 25K 325K FREE
4 50K 350K Program2 BUSY
5 50K 400K FREE
 Which looks like this
in memory:
 Which looks like this
in memory:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
250K
100K
25K
25K
50K
50K
 Let’s add some
programs in:
 Let’s add some
programs in:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
100K
25K
25K
50K
50K
250K
 Let’s add some
programs in:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
100K
25K
25K
50K
50K
PROGRAM 1
250K
 Let’s add some
programs in:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
100K
25K
25K
50K
50K
PROGRAM 1
PROGRAM 2
250K
 Let’s add some
programs in:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
100K
25K
25K
50K
50K
PROGRAM 1
PROGRAM 2
250K
PROGRAM 3
 Let’s add some
programs in:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
100K
25K
25K
50K
50K
PROGRAM 1
PROGRAM 2
PROGRAM 3
250K
INTERNAL FRAGMENTATION
 Let’s add some
programs in:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
100K
25K
25K
50K
50K
PROGRAM 1
PROGRAM 2
PROGRAM 3
250K
INTERNAL FRAGMENTATION
INTERNAL FRAGMENTATION
 Let’s add some
programs in:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
100K
25K
25K
50K
50K
PROGRAM 1
PROGRAM 2
PROGRAM 3
250K
INTERNAL FRAGMENTATION
INTERNAL FRAGMENTATION
EMPTY PARTITION
 Let’s add some
programs in:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
100K
25K
25K
50K
50K
PROGRAM 1
PROGRAM 2
PROGRAM 3
250K
INTERNAL FRAGMENTATION
INTERNAL FRAGMENTATION
EMPTY PARTITION
EMPTY PARTITION
 Selecting the correct set of partition sizes is a
tricky business, too small and larger
programs will be waiting forever to run, too
big and there is a lot of wasted space.
 An alternative is DYNAMIC PARTITIONS,
where a program is given the space it
requests, if there is space available for it.
 This takes care of lots of problems.
 Let’s add some
programs in:
MAIN
MEMORY
250K
 Let’s add some
programs in:
MAIN
MEMORY
250K
PROGRAM 1
 Let’s add some
programs in:
MAIN
MEMORY
PROGRAM 1
250K
 Let’s add some
programs in:
MAIN
MEMORY
PROGRAM 1
PROGRAM 2
250K
 Let’s add some
programs in:
MAIN
MEMORY
PROGRAM 1
PROGRAM 2
250K
 Let’s add some
programs in:
MAIN
MEMORY
PROGRAM 1
PROGRAM 2
PROGRAM 3
250K
 Let’s add some
programs in:
MAIN
MEMORY
PROGRAM 1
PROGRAM 2
PROGRAM 3250K
 Let’s add some
programs in:
MAIN
MEMORY
PROGRAM 1
PROGRAM 2
PROGRAM 3250KPROGRAM 4
 Let’s add some
programs in:
MAIN
MEMORY
PROGRAM 1
PROGRAM 2
PROGRAM 3250K
PROGRAM 4
 Let’s add some
programs in:
MAIN
MEMORY
PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
PROGRAM 3
 Let’s add some
programs in:
MAIN
MEMORY
PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
PROGRAM 3
 It isn’t perfect, because the next program will
go into the slot that is freed up by a
completed program.
 Let’s add some
programs in:
MAIN
MEMORY
PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
PROGRAM 3
 Let’s add some
programs in:
MAIN
MEMORY
PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
PROGRAM 3
 Let’s add some
programs in: PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
 Let’s add some
programs in: PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
 Let’s add some
programs in: PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
EXTERNAL FRAGMENTATION
 So however we partition, we end up with
fragmentation, one way or the other.
PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
PROGRAM 3
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
 So how do we decide
where to slot in a
new program?
PROGRAM 3
PROGRAM 1
 So how do we decide
where to slot in a
new program? PROGRAM 2
PROGRAM 3 250K
PROGRAM 4
PROGRAM 5
PROGRAM 6
PROGRAM 1
 Here is the first slot
free
PROGRAM 2
PROGRAM 3 250K
PROGRAM 4
PROGRAM 5
PROGRAM 6
PROGRAM 1
 Here is the first slot
free
PROGRAM 2
PROGRAM 3 250K
PROGRAM 4
PROGRAM 5
PROGRAM 6
PROGRAM 1
 But here’s a better fit
PROGRAM 2
PROGRAM 3 250K
PROGRAM 4
PROGRAM 5
PROGRAM 6
PROGRAM 1
 But here’s a better fit
PROGRAM 2
PROGRAM 3 250K
PROGRAM 4
PROGRAM 5
PROGRAM 6
PROGRAM 1
 So we can either add the new block to the
first available slot (FIRST-FIT ALGORITHM) or
we can add the new block to the most
suitable available slot (BEST-FIT ALGORITHM).
 If the Memory Manager wants a FIRST-FIT
ALGORITHM then it stores a table in order of
memory locations.
 If the Memory Manager wants a BEST-FIT
ALGORITHM then it stores a table in order of
size of memory locations.
Starts Size Status
200 50 BUSY
250 50 FREE
300 15 BUSY
315 40 FREE
355 25 BUSY
Starts Size Status
315 40 FREE
250 50 FREE
300 15 BUSY
355 25 BUSY
315 40 BUSY
Starts Size Status
 After a program is completed, there are three
cases for deallocating space in memory:
 1. There are programs either side of the freed
space:
PROGRAM 3
PROGRAM 4
PROGRAM 6
PROGRAM 3
PROGRAM 4
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
 2. There are is a program on one side, and
it’s free on the other side of the freed space:
PROGRAM 3
PROGRAM 6
PROGRAM 3
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
 3. There are no programs on either side of
the freed space:
PROGRAM 6
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
 Let’s look at the implications of each of these
cases in terms of what the Memory Manager
has to do to remember the FREE and BUSY
memory spaces.
 1. There are programs either side of the freed
space:
PROGRAM 3
PROGRAM 4
PROGRAM 6
PROGRAM 3
PROGRAM 4
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
 1. There are programs either side of the freed
space:
PROGRAM 3
PROGRAM 4
PROGRAM 6
PROGRAM 3
PROGRAM 4
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
250-300
315-340
300-315
200-250
355-380
340-355
250-300
315-340
300-315
200-250
355-380
340-355
 1. There are programs either side of the freed
space:
250-300
315-340
300-315
200-250
355-380
340-355
250-300
315-340
300-315
200-250
355-380
340-355
Starts Size Status
200 50 BUSY
250 50 BUSY
300 15 BUSY
315 25 BUSY
340 15 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 50 BUSY
300 15 FREE
315 25 BUSY
340 15 FREE
355 25 BUSY
 2. There are is a program on one side, and
it’s free on the other side of the freed space:
PROGRAM 3
PROGRAM 6
PROGRAM 3
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
 2. There are is a program on one side, and
it’s free on the other side of the freed space:
PROGRAM 3
PROGRAM 6
PROGRAM 3
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
250-300
300-315
200-250
355-380
315-355
250-300
200-250
355-380
300-355
 2. There are is a program on one side, and
it’s free on the other side of the freed space:
250-300
300-315
200-250
355-380
315-355
250-300
200-250
355-380
300-355
Starts Size Status
200 50 BUSY
250 50 BUSY
300 15 BUSY
315 40 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 50 BUSY
300 15 FREE
315 40 FREE
355 25 BUSY
 2. There are is a program on one side, and
it’s free on the other side of the freed space:
Starts Size Status
200 50 BUSY
250 50 BUSY
300 15 BUSY
315 40 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 50 BUSY
300 15 FREE
315 40 FREE
355 25 BUSY
 2. There are is a program on one side, and
it’s free on the other side of the freed space:
Starts Size Status
200 50 BUSY
250 50 BUSY
300 15 BUSY
315 40 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 50 BUSY
300 15 FREE
315 40 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 50 BUSY
300 55 FREE
355 25 BUSY
 3. There are no programs on either side of
the freed space:
PROGRAM 6
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
 3. There are no programs on either side of
the freed space:
PROGRAM 6
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
250-300
300-315
200-250
355-380
315-355
250-355
200-250
355-380
 3. There are no programs on either side of
the freed space:
250-300
300-315
200-250
355-380
315-355
250-355
200-250
355-380
Starts Size Status
200 50 BUSY
250 50 FREE
300 15 BUSY
315 40 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 50 FREE
300 15 FREE
315 40 FREE
355 25 BUSY
 3. There are no programs on either side of
the freed space:
Starts Size Status
200 50 BUSY
250 50 FREE
300 15 BUSY
315 40 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 50 FREE
300 15 FREE
315 40 FREE
355 25 BUSY
 3. There are no programs on either side of
the freed space:
Starts Size Status
200 50 BUSY
250 50 FREE
300 15 BUSY
315 40 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 50 FREE
300 15 FREE
315 40 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 105 FREE
355 25 BUSY

More Related Content

What's hot

8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
Dr. Loganathan R
 
Operating system ch#7
Operating system ch#7Operating system ch#7
Operating system ch#7
Noor Noon
 
Chapter 1 - Introduction
Chapter 1 - IntroductionChapter 1 - Introduction
Chapter 1 - IntroductionWayne Jones Jnr
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
priyadeosarkar91
 
Os unit 3
Os unit 3Os unit 3
Os unit 3
SandhyaTatekalva
 
Operating Systems - memory management
Operating Systems - memory managementOperating Systems - memory management
Operating Systems - memory management
Mukesh Chinta
 
Dynamic loading
Dynamic loadingDynamic loading
Dynamic loading
A. S. M. Shafi
 
Memory management OS
Memory management OSMemory management OS
Memory management OS
UmeshchandraYadav5
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
Negar Neda
 
Operating Systems Part III-Memory Management
Operating Systems Part III-Memory ManagementOperating Systems Part III-Memory Management
Operating Systems Part III-Memory Management
Ajit Nayak
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
Kumar Pritam
 
Processor management
Processor managementProcessor management
Processor management
dev3993
 
Operating Systems 1 (9/12) - Memory Management Concepts
Operating Systems 1 (9/12) - Memory Management ConceptsOperating Systems 1 (9/12) - Memory Management Concepts
Operating Systems 1 (9/12) - Memory Management Concepts
Peter Tröger
 
CS6401 OPERATING SYSTEMS Unit 3
CS6401 OPERATING SYSTEMS Unit 3CS6401 OPERATING SYSTEMS Unit 3
CS6401 OPERATING SYSTEMS Unit 3
Kathirvel Ayyaswamy
 
Memory managment
Memory managmentMemory managment
Memory managment
Shahbaz Khan
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process management
Arnav Chowdhury
 
Cs8493 unit 3
Cs8493 unit 3Cs8493 unit 3
Cs8493 unit 3
Kathirvel Ayyaswamy
 
Opetating System Memory management
Opetating System Memory managementOpetating System Memory management
Opetating System Memory management
Johan Granados Montero
 
Memory management
Memory managementMemory management
Memory management
soumyaharitha
 

What's hot (20)

8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
Operating system ch#7
Operating system ch#7Operating system ch#7
Operating system ch#7
 
Chapter 1 - Introduction
Chapter 1 - IntroductionChapter 1 - Introduction
Chapter 1 - Introduction
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
 
Os unit 3
Os unit 3Os unit 3
Os unit 3
 
Operating Systems - memory management
Operating Systems - memory managementOperating Systems - memory management
Operating Systems - memory management
 
Memory
MemoryMemory
Memory
 
Dynamic loading
Dynamic loadingDynamic loading
Dynamic loading
 
Memory management OS
Memory management OSMemory management OS
Memory management OS
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Operating Systems Part III-Memory Management
Operating Systems Part III-Memory ManagementOperating Systems Part III-Memory Management
Operating Systems Part III-Memory Management
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Processor management
Processor managementProcessor management
Processor management
 
Operating Systems 1 (9/12) - Memory Management Concepts
Operating Systems 1 (9/12) - Memory Management ConceptsOperating Systems 1 (9/12) - Memory Management Concepts
Operating Systems 1 (9/12) - Memory Management Concepts
 
CS6401 OPERATING SYSTEMS Unit 3
CS6401 OPERATING SYSTEMS Unit 3CS6401 OPERATING SYSTEMS Unit 3
CS6401 OPERATING SYSTEMS Unit 3
 
Memory managment
Memory managmentMemory managment
Memory managment
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process management
 
Cs8493 unit 3
Cs8493 unit 3Cs8493 unit 3
Cs8493 unit 3
 
Opetating System Memory management
Opetating System Memory managementOpetating System Memory management
Opetating System Memory management
 
Memory management
Memory managementMemory management
Memory management
 

Viewers also liked

Operating Systems: Virtual Memory
Operating Systems: Virtual MemoryOperating Systems: Virtual Memory
Operating Systems: Virtual Memory
Damian T. Gordon
 
Operating Systems: Computer Security
Operating Systems: Computer SecurityOperating Systems: Computer Security
Operating Systems: Computer Security
Damian T. Gordon
 
Operating Systems: Network Management
Operating Systems: Network ManagementOperating Systems: Network Management
Operating Systems: Network Management
Damian T. Gordon
 
Operating Systems: File Management
Operating Systems: File ManagementOperating Systems: File Management
Operating Systems: File Management
Damian T. Gordon
 
Operating Systems: Device Management
Operating Systems: Device ManagementOperating Systems: Device Management
Operating Systems: Device Management
Damian T. Gordon
 
Simple Data Compression
Simple Data CompressionSimple Data Compression
Simple Data Compression
Damian T. Gordon
 
Operating Systems: A History of MacOS
Operating Systems: A History of MacOSOperating Systems: A History of MacOS
Operating Systems: A History of MacOS
Damian T. Gordon
 
James Bond and the OSI Model
James Bond and the OSI ModelJames Bond and the OSI Model
James Bond and the OSI Model
Damian T. Gordon
 
Operating Systems: Data Structures
Operating Systems: Data StructuresOperating Systems: Data Structures
Operating Systems: Data Structures
Damian T. Gordon
 
Operating Systems: Process Scheduling
Operating Systems: Process SchedulingOperating Systems: Process Scheduling
Operating Systems: Process Scheduling
Damian T. Gordon
 
Operating Systems and Memory Management
Operating Systems and Memory ManagementOperating Systems and Memory Management
Operating Systems and Memory Management
guest1415ae65
 
Operating Systems: What happen in 2016?
Operating Systems: What happen in 2016?Operating Systems: What happen in 2016?
Operating Systems: What happen in 2016?
Damian T. Gordon
 
Operating Systems 1: Introduction
Operating Systems 1: IntroductionOperating Systems 1: Introduction
Operating Systems 1: Introduction
Damian T. Gordon
 
Operating Systems: History of Windows
Operating Systems: History of WindowsOperating Systems: History of Windows
Operating Systems: History of Windows
Damian T. Gordon
 
Operating Systems 1: Syllabus
Operating Systems 1: SyllabusOperating Systems 1: Syllabus
Operating Systems 1: Syllabus
Damian T. Gordon
 
Operating Systems: The Little-Man Computer
Operating Systems: The Little-Man ComputerOperating Systems: The Little-Man Computer
Operating Systems: The Little-Man Computer
Damian T. Gordon
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory Management
Akmal Cikmat
 
Memory management
Memory managementMemory management
Memory management
Muhammad Fayyaz
 
Memory management
Memory managementMemory management
Memory management
Vishal Singh
 

Viewers also liked (20)

Operating Systems: Virtual Memory
Operating Systems: Virtual MemoryOperating Systems: Virtual Memory
Operating Systems: Virtual Memory
 
Operating Systems: Computer Security
Operating Systems: Computer SecurityOperating Systems: Computer Security
Operating Systems: Computer Security
 
Operating Systems: Network Management
Operating Systems: Network ManagementOperating Systems: Network Management
Operating Systems: Network Management
 
Operating Systems: File Management
Operating Systems: File ManagementOperating Systems: File Management
Operating Systems: File Management
 
Operating Systems: Device Management
Operating Systems: Device ManagementOperating Systems: Device Management
Operating Systems: Device Management
 
Simple Data Compression
Simple Data CompressionSimple Data Compression
Simple Data Compression
 
Operating Systems: A History of MacOS
Operating Systems: A History of MacOSOperating Systems: A History of MacOS
Operating Systems: A History of MacOS
 
James Bond and the OSI Model
James Bond and the OSI ModelJames Bond and the OSI Model
James Bond and the OSI Model
 
Operating Systems: Data Structures
Operating Systems: Data StructuresOperating Systems: Data Structures
Operating Systems: Data Structures
 
Operating Systems: Process Scheduling
Operating Systems: Process SchedulingOperating Systems: Process Scheduling
Operating Systems: Process Scheduling
 
Operating Systems and Memory Management
Operating Systems and Memory ManagementOperating Systems and Memory Management
Operating Systems and Memory Management
 
Operating Systems: What happen in 2016?
Operating Systems: What happen in 2016?Operating Systems: What happen in 2016?
Operating Systems: What happen in 2016?
 
Operating Systems 1: Introduction
Operating Systems 1: IntroductionOperating Systems 1: Introduction
Operating Systems 1: Introduction
 
Operating Systems: History of Windows
Operating Systems: History of WindowsOperating Systems: History of Windows
Operating Systems: History of Windows
 
Operating Systems 1: Syllabus
Operating Systems 1: SyllabusOperating Systems 1: Syllabus
Operating Systems 1: Syllabus
 
Memory management
Memory managementMemory management
Memory management
 
Operating Systems: The Little-Man Computer
Operating Systems: The Little-Man ComputerOperating Systems: The Little-Man Computer
Operating Systems: The Little-Man Computer
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory Management
 
Memory management
Memory managementMemory management
Memory management
 
Memory management
Memory managementMemory management
Memory management
 

Similar to Operating Systems: Memory Management

Operating Systems: Revision
Operating Systems: RevisionOperating Systems: Revision
Operating Systems: Revision
Damian T. Gordon
 
Google Glass Mirror API Setup
Google Glass Mirror API SetupGoogle Glass Mirror API Setup
Google Glass Mirror API Setup
Diana Michelle
 
How To Make System Work Faster
How To Make System Work FasterHow To Make System Work Faster
How To Make System Work FasterGaurav bhatnagar
 
Dynamic debugging in 8085 microprocessor
Dynamic debugging in 8085 microprocessorDynamic debugging in 8085 microprocessor
Dynamic debugging in 8085 microprocessor
RamaPrabha24
 
Low memory footprint programs-iSeries
Low memory footprint programs-iSeriesLow memory footprint programs-iSeries
Low memory footprint programs-iSeries
Prithiviraj Damodaran
 
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using MetasploitPrivileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
Vishal Kumar
 
install k+dcan cable standard tools 2.12 on windows 10 64bit
install k+dcan cable standard tools 2.12 on windows 10 64bitinstall k+dcan cable standard tools 2.12 on windows 10 64bit
install k+dcan cable standard tools 2.12 on windows 10 64bit
WORLD OBD2
 
Loadnrun: UKIUA 2010 Presentation
Loadnrun: UKIUA 2010 PresentationLoadnrun: UKIUA 2010 Presentation
Loadnrun: UKIUA 2010 Presentation
roydealsimon
 
Time Log with Payment Add on User Manual
Time Log with Payment Add on User ManualTime Log with Payment Add on User Manual
Time Log with Payment Add on User Manual
Orangescrum
 
Sample - Test Cases - Adobe Flash
Sample - Test Cases - Adobe FlashSample - Test Cases - Adobe Flash
Sample - Test Cases - Adobe FlashBob Powers
 
Abapdebuggingfrombasictoadvance 140214043218-phpapp01
Abapdebuggingfrombasictoadvance 140214043218-phpapp01Abapdebuggingfrombasictoadvance 140214043218-phpapp01
Abapdebuggingfrombasictoadvance 140214043218-phpapp01
IT TRAINER
 
ES-CH5.ppt
ES-CH5.pptES-CH5.ppt
ES-CH5.ppt
alaakaraja1
 
How to put 10lbs of functionality into a 5lb package.
How to put 10lbs of functionality into a 5lb package.How to put 10lbs of functionality into a 5lb package.
How to put 10lbs of functionality into a 5lb package.
Marc Karasek
 
Profiling and optimizing go programs
Profiling and optimizing go programsProfiling and optimizing go programs
Profiling and optimizing go programs
Badoo Development
 
6048618 cloning-procedure-of-r12-single-tier
6048618 cloning-procedure-of-r12-single-tier6048618 cloning-procedure-of-r12-single-tier
6048618 cloning-procedure-of-r12-single-tierbalaji29
 
St22 abap programming
St22 abap programming St22 abap programming
St22 abap programming
nanda nanda
 

Similar to Operating Systems: Memory Management (20)

Operating Systems: Revision
Operating Systems: RevisionOperating Systems: Revision
Operating Systems: Revision
 
Google Glass Mirror API Setup
Google Glass Mirror API SetupGoogle Glass Mirror API Setup
Google Glass Mirror API Setup
 
How To Make System Work Faster
How To Make System Work FasterHow To Make System Work Faster
How To Make System Work Faster
 
Dynamic debugging in 8085 microprocessor
Dynamic debugging in 8085 microprocessorDynamic debugging in 8085 microprocessor
Dynamic debugging in 8085 microprocessor
 
PLC: Easy PLC User manual
PLC: Easy PLC User manualPLC: Easy PLC User manual
PLC: Easy PLC User manual
 
Users guide
Users guideUsers guide
Users guide
 
Picaxe manual5
Picaxe manual5Picaxe manual5
Picaxe manual5
 
Low memory footprint programs-iSeries
Low memory footprint programs-iSeriesLow memory footprint programs-iSeries
Low memory footprint programs-iSeries
 
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using MetasploitPrivileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
 
install k+dcan cable standard tools 2.12 on windows 10 64bit
install k+dcan cable standard tools 2.12 on windows 10 64bitinstall k+dcan cable standard tools 2.12 on windows 10 64bit
install k+dcan cable standard tools 2.12 on windows 10 64bit
 
Loadnrun: UKIUA 2010 Presentation
Loadnrun: UKIUA 2010 PresentationLoadnrun: UKIUA 2010 Presentation
Loadnrun: UKIUA 2010 Presentation
 
Time Log with Payment Add on User Manual
Time Log with Payment Add on User ManualTime Log with Payment Add on User Manual
Time Log with Payment Add on User Manual
 
Sample - Test Cases - Adobe Flash
Sample - Test Cases - Adobe FlashSample - Test Cases - Adobe Flash
Sample - Test Cases - Adobe Flash
 
Basic Debugging
Basic DebuggingBasic Debugging
Basic Debugging
 
Abapdebuggingfrombasictoadvance 140214043218-phpapp01
Abapdebuggingfrombasictoadvance 140214043218-phpapp01Abapdebuggingfrombasictoadvance 140214043218-phpapp01
Abapdebuggingfrombasictoadvance 140214043218-phpapp01
 
ES-CH5.ppt
ES-CH5.pptES-CH5.ppt
ES-CH5.ppt
 
How to put 10lbs of functionality into a 5lb package.
How to put 10lbs of functionality into a 5lb package.How to put 10lbs of functionality into a 5lb package.
How to put 10lbs of functionality into a 5lb package.
 
Profiling and optimizing go programs
Profiling and optimizing go programsProfiling and optimizing go programs
Profiling and optimizing go programs
 
6048618 cloning-procedure-of-r12-single-tier
6048618 cloning-procedure-of-r12-single-tier6048618 cloning-procedure-of-r12-single-tier
6048618 cloning-procedure-of-r12-single-tier
 
St22 abap programming
St22 abap programming St22 abap programming
St22 abap programming
 

More from Damian T. Gordon

Universal Design for Learning, Co-Designing with Students.
Universal Design for Learning, Co-Designing with Students.Universal Design for Learning, Co-Designing with Students.
Universal Design for Learning, Co-Designing with Students.
Damian T. Gordon
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
Damian T. Gordon
 
REST and RESTful Services
REST and RESTful ServicesREST and RESTful Services
REST and RESTful Services
Damian T. Gordon
 
Serverless Computing
Serverless ComputingServerless Computing
Serverless Computing
Damian T. Gordon
 
Cloud Identity Management
Cloud Identity ManagementCloud Identity Management
Cloud Identity Management
Damian T. Gordon
 
Containers and Docker
Containers and DockerContainers and Docker
Containers and Docker
Damian T. Gordon
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud Computing
Damian T. Gordon
 
Introduction to ChatGPT
Introduction to ChatGPTIntroduction to ChatGPT
Introduction to ChatGPT
Damian T. Gordon
 
How to Argue Logically
How to Argue LogicallyHow to Argue Logically
How to Argue Logically
Damian T. Gordon
 
Evaluating Teaching: SECTIONS
Evaluating Teaching: SECTIONSEvaluating Teaching: SECTIONS
Evaluating Teaching: SECTIONS
Damian T. Gordon
 
Evaluating Teaching: MERLOT
Evaluating Teaching: MERLOTEvaluating Teaching: MERLOT
Evaluating Teaching: MERLOT
Damian T. Gordon
 
Evaluating Teaching: Anstey and Watson Rubric
Evaluating Teaching: Anstey and Watson RubricEvaluating Teaching: Anstey and Watson Rubric
Evaluating Teaching: Anstey and Watson Rubric
Damian T. Gordon
 
Evaluating Teaching: LORI
Evaluating Teaching: LORIEvaluating Teaching: LORI
Evaluating Teaching: LORI
Damian T. Gordon
 
Designing Teaching: Pause Procedure
Designing Teaching: Pause ProcedureDesigning Teaching: Pause Procedure
Designing Teaching: Pause Procedure
Damian T. Gordon
 
Designing Teaching: ADDIE
Designing Teaching: ADDIEDesigning Teaching: ADDIE
Designing Teaching: ADDIE
Damian T. Gordon
 
Designing Teaching: ASSURE
Designing Teaching: ASSUREDesigning Teaching: ASSURE
Designing Teaching: ASSURE
Damian T. Gordon
 
Designing Teaching: Laurilliard's Learning Types
Designing Teaching: Laurilliard's Learning TypesDesigning Teaching: Laurilliard's Learning Types
Designing Teaching: Laurilliard's Learning Types
Damian T. Gordon
 
Designing Teaching: Gagne's Nine Events of Instruction
Designing Teaching: Gagne's Nine Events of InstructionDesigning Teaching: Gagne's Nine Events of Instruction
Designing Teaching: Gagne's Nine Events of Instruction
Damian T. Gordon
 
Designing Teaching: Elaboration Theory
Designing Teaching: Elaboration TheoryDesigning Teaching: Elaboration Theory
Designing Teaching: Elaboration Theory
Damian T. Gordon
 
Universally Designed Learning Spaces: Some Considerations
Universally Designed Learning Spaces: Some ConsiderationsUniversally Designed Learning Spaces: Some Considerations
Universally Designed Learning Spaces: Some Considerations
Damian T. Gordon
 

More from Damian T. Gordon (20)

Universal Design for Learning, Co-Designing with Students.
Universal Design for Learning, Co-Designing with Students.Universal Design for Learning, Co-Designing with Students.
Universal Design for Learning, Co-Designing with Students.
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
REST and RESTful Services
REST and RESTful ServicesREST and RESTful Services
REST and RESTful Services
 
Serverless Computing
Serverless ComputingServerless Computing
Serverless Computing
 
Cloud Identity Management
Cloud Identity ManagementCloud Identity Management
Cloud Identity Management
 
Containers and Docker
Containers and DockerContainers and Docker
Containers and Docker
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud Computing
 
Introduction to ChatGPT
Introduction to ChatGPTIntroduction to ChatGPT
Introduction to ChatGPT
 
How to Argue Logically
How to Argue LogicallyHow to Argue Logically
How to Argue Logically
 
Evaluating Teaching: SECTIONS
Evaluating Teaching: SECTIONSEvaluating Teaching: SECTIONS
Evaluating Teaching: SECTIONS
 
Evaluating Teaching: MERLOT
Evaluating Teaching: MERLOTEvaluating Teaching: MERLOT
Evaluating Teaching: MERLOT
 
Evaluating Teaching: Anstey and Watson Rubric
Evaluating Teaching: Anstey and Watson RubricEvaluating Teaching: Anstey and Watson Rubric
Evaluating Teaching: Anstey and Watson Rubric
 
Evaluating Teaching: LORI
Evaluating Teaching: LORIEvaluating Teaching: LORI
Evaluating Teaching: LORI
 
Designing Teaching: Pause Procedure
Designing Teaching: Pause ProcedureDesigning Teaching: Pause Procedure
Designing Teaching: Pause Procedure
 
Designing Teaching: ADDIE
Designing Teaching: ADDIEDesigning Teaching: ADDIE
Designing Teaching: ADDIE
 
Designing Teaching: ASSURE
Designing Teaching: ASSUREDesigning Teaching: ASSURE
Designing Teaching: ASSURE
 
Designing Teaching: Laurilliard's Learning Types
Designing Teaching: Laurilliard's Learning TypesDesigning Teaching: Laurilliard's Learning Types
Designing Teaching: Laurilliard's Learning Types
 
Designing Teaching: Gagne's Nine Events of Instruction
Designing Teaching: Gagne's Nine Events of InstructionDesigning Teaching: Gagne's Nine Events of Instruction
Designing Teaching: Gagne's Nine Events of Instruction
 
Designing Teaching: Elaboration Theory
Designing Teaching: Elaboration TheoryDesigning Teaching: Elaboration Theory
Designing Teaching: Elaboration Theory
 
Universally Designed Learning Spaces: Some Considerations
Universally Designed Learning Spaces: Some ConsiderationsUniversally Designed Learning Spaces: Some Considerations
Universally Designed Learning Spaces: Some Considerations
 

Recently uploaded

Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 

Recently uploaded (20)

Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 

Operating Systems: Memory Management

  • 2.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 12. HARD DISK (MAIN MEMORY) (SECONDARY MEMORY) 2 CACHE 1 101 Approximate number of clock cycles to access the various elements of the memory hierarchy.
  • 13. HARD DISK (MAIN MEMORY) (SECONDARY MEMORY) 2 CACHE 1 101 103 Approximate number of clock cycles to access the various elements of the memory hierarchy.
  • 14. HARD DISK (MAIN MEMORY) (SECONDARY MEMORY) 2 CACHE 1 101 103 107 Approximate number of clock cycles to access the various elements of the memory hierarchy.
  • 15.  Let’s consider an operating system model with a single user, and how they use memory.
  • 18.  If I create a program: 200K available MAIN MEMORY
  • 19.  If I create a program: PROGRAM 1 200K available MAIN MEMORY
  • 20.  If I create a program:  to be processed, it has to be written entirely into Main Memory, in contiguous space PROGRAM 1 200K available MAIN MEMORY
  • 22.  If the program is bigger: PROGRAM 1 200K available MAIN MEMORY
  • 23.  If it doesn’t fit in the memory, it’s can’t be processed. 200K available MAIN MEMORY
  • 24.  This is the limitation of all computers, if a program is too big, we have to do one of two things: 1. Get more memory 2. Make the program smaller
  • 25. Store first location of program in the base register (for memory protection); Set Program Counter to the first memory location; Read first instruction of program; WHILE (last instruction reached OR Program Counter is greater than Memory Size) DO Increment the Program Counter; IF (last instruction reached) THEN Stop Loading Program; END IF; IF (Program Counter is greater than Memory Size) THEN Stop Loading Program; END IF; Load instruction into memory; Read next instruction of program; END WHILE;
  • 26.  To allow more than one program to run at the same time, the memory is subdivided into FIXED PARTITIONS.
  • 28. PARTITION 1 PARTITION 2 PARTITION 3 PARTITION 4 PARTITION 5 250K 100K 25K 25K 50K 50K
  • 29.  This leaves us with less memory, but at least more than one user (and their user process) can be logged into the system at the same time.  If we want to adjust the size of the partitions we need to shut down the system, go into the boot login, and then restart.
  • 30. WHILE (there are still programs in the queue) DO Determine the program’s requested memory size; IF program size > Size of Largest Partition THEN Reject the program; PRINT “program Rejected: Not Enough Memory”; Exit; /* this iteration and get next program */ END IF; MyCounter := 1; WHILE (MyCounter <= Number of Partitions in Memory) DO IF (program Size > Memory_Partition[Counter].Size THEN MyCounter := MyCounter + 1; ELSE IF (Memory_Partition[Counter].Status == “FREE”; THEN Load program into Memory_Partition[Counter]; Memory_Partition[Counter].Status := “BUSY”; Exit; /* this iteration and get next program */ ELSE MyCounter := MyCounter + 1; END IF; END WHILE; No partition available; put program in waiting queue; END WHILE;
  • 31.  To make this work, the Memory manager needs to keep a Partition Table to remember the status of all the partitions.
  • 32.  To make this work, the Memory manager needs to keep a Partition Table to remember the status of all the partitions. Partition Number Partition Size Memory Address Access Partition Status 1 100K 200K Program1 BUSY 2 25K 300K Program4 BUSY 3 25K 325K FREE 4 50K 350K Program2 BUSY 5 50K 400K FREE
  • 33.  Which looks like this in memory:
  • 34.  Which looks like this in memory: PARTITION 1 PARTITION 2 PARTITION 3 PARTITION 4 PARTITION 5 250K 100K 25K 25K 50K 50K
  • 35.  Let’s add some programs in:
  • 36.  Let’s add some programs in: PARTITION 1 PARTITION 2 PARTITION 3 PARTITION 4 PARTITION 5 100K 25K 25K 50K 50K 250K
  • 37.  Let’s add some programs in: PARTITION 1 PARTITION 2 PARTITION 3 PARTITION 4 PARTITION 5 100K 25K 25K 50K 50K PROGRAM 1 250K
  • 38.  Let’s add some programs in: PARTITION 1 PARTITION 2 PARTITION 3 PARTITION 4 PARTITION 5 100K 25K 25K 50K 50K PROGRAM 1 PROGRAM 2 250K
  • 39.  Let’s add some programs in: PARTITION 1 PARTITION 2 PARTITION 3 PARTITION 4 PARTITION 5 100K 25K 25K 50K 50K PROGRAM 1 PROGRAM 2 250K PROGRAM 3
  • 40.  Let’s add some programs in: PARTITION 1 PARTITION 2 PARTITION 3 PARTITION 4 PARTITION 5 100K 25K 25K 50K 50K PROGRAM 1 PROGRAM 2 PROGRAM 3 250K INTERNAL FRAGMENTATION
  • 41.  Let’s add some programs in: PARTITION 1 PARTITION 2 PARTITION 3 PARTITION 4 PARTITION 5 100K 25K 25K 50K 50K PROGRAM 1 PROGRAM 2 PROGRAM 3 250K INTERNAL FRAGMENTATION INTERNAL FRAGMENTATION
  • 42.  Let’s add some programs in: PARTITION 1 PARTITION 2 PARTITION 3 PARTITION 4 PARTITION 5 100K 25K 25K 50K 50K PROGRAM 1 PROGRAM 2 PROGRAM 3 250K INTERNAL FRAGMENTATION INTERNAL FRAGMENTATION EMPTY PARTITION
  • 43.  Let’s add some programs in: PARTITION 1 PARTITION 2 PARTITION 3 PARTITION 4 PARTITION 5 100K 25K 25K 50K 50K PROGRAM 1 PROGRAM 2 PROGRAM 3 250K INTERNAL FRAGMENTATION INTERNAL FRAGMENTATION EMPTY PARTITION EMPTY PARTITION
  • 44.  Selecting the correct set of partition sizes is a tricky business, too small and larger programs will be waiting forever to run, too big and there is a lot of wasted space.
  • 45.  An alternative is DYNAMIC PARTITIONS, where a program is given the space it requests, if there is space available for it.  This takes care of lots of problems.
  • 46.  Let’s add some programs in: MAIN MEMORY 250K
  • 47.  Let’s add some programs in: MAIN MEMORY 250K PROGRAM 1
  • 48.  Let’s add some programs in: MAIN MEMORY PROGRAM 1 250K
  • 49.  Let’s add some programs in: MAIN MEMORY PROGRAM 1 PROGRAM 2 250K
  • 50.  Let’s add some programs in: MAIN MEMORY PROGRAM 1 PROGRAM 2 250K
  • 51.  Let’s add some programs in: MAIN MEMORY PROGRAM 1 PROGRAM 2 PROGRAM 3 250K
  • 52.  Let’s add some programs in: MAIN MEMORY PROGRAM 1 PROGRAM 2 PROGRAM 3250K
  • 53.  Let’s add some programs in: MAIN MEMORY PROGRAM 1 PROGRAM 2 PROGRAM 3250KPROGRAM 4
  • 54.  Let’s add some programs in: MAIN MEMORY PROGRAM 1 PROGRAM 2 PROGRAM 3250K PROGRAM 4
  • 55.  Let’s add some programs in: MAIN MEMORY PROGRAM 1 PROGRAM 2 250K PROGRAM 4 PROGRAM 5 PROGRAM 3
  • 56.  Let’s add some programs in: MAIN MEMORY PROGRAM 1 PROGRAM 2 250K PROGRAM 4 PROGRAM 5 PROGRAM 3
  • 57.  It isn’t perfect, because the next program will go into the slot that is freed up by a completed program.
  • 58.  Let’s add some programs in: MAIN MEMORY PROGRAM 1 PROGRAM 2 250K PROGRAM 4 PROGRAM 5 PROGRAM 3
  • 59.  Let’s add some programs in: MAIN MEMORY PROGRAM 1 PROGRAM 2 250K PROGRAM 4 PROGRAM 5 PROGRAM 3
  • 60.  Let’s add some programs in: PROGRAM 1 PROGRAM 2 250K PROGRAM 4 PROGRAM 5
  • 61.  Let’s add some programs in: PROGRAM 1 PROGRAM 2 250K PROGRAM 4 PROGRAM 5
  • 62.  Let’s add some programs in: PROGRAM 1 PROGRAM 2 250K PROGRAM 4 PROGRAM 5 EXTERNAL FRAGMENTATION
  • 63.  So however we partition, we end up with fragmentation, one way or the other.
  • 64. PROGRAM 1 PROGRAM 2 250K PROGRAM 4 PROGRAM 5 PROGRAM 3
  • 65. PROGRAM 2 250K PROGRAM 4 PROGRAM 5  So how do we decide where to slot in a new program? PROGRAM 3 PROGRAM 1
  • 66.  So how do we decide where to slot in a new program? PROGRAM 2 PROGRAM 3 250K PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 1
  • 67.  Here is the first slot free PROGRAM 2 PROGRAM 3 250K PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 1
  • 68.  Here is the first slot free PROGRAM 2 PROGRAM 3 250K PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 1
  • 69.  But here’s a better fit PROGRAM 2 PROGRAM 3 250K PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 1
  • 70.  But here’s a better fit PROGRAM 2 PROGRAM 3 250K PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 1
  • 71.  So we can either add the new block to the first available slot (FIRST-FIT ALGORITHM) or we can add the new block to the most suitable available slot (BEST-FIT ALGORITHM).
  • 72.  If the Memory Manager wants a FIRST-FIT ALGORITHM then it stores a table in order of memory locations.  If the Memory Manager wants a BEST-FIT ALGORITHM then it stores a table in order of size of memory locations. Starts Size Status 200 50 BUSY 250 50 FREE 300 15 BUSY 315 40 FREE 355 25 BUSY Starts Size Status 315 40 FREE 250 50 FREE 300 15 BUSY 355 25 BUSY 315 40 BUSY Starts Size Status
  • 73.  After a program is completed, there are three cases for deallocating space in memory:
  • 74.  1. There are programs either side of the freed space: PROGRAM 3 PROGRAM 4 PROGRAM 6 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 5 PROGRAM 8 PROGRAM 8
  • 75.  2. There are is a program on one side, and it’s free on the other side of the freed space: PROGRAM 3 PROGRAM 6 PROGRAM 3 PROGRAM 5 PROGRAM 5 PROGRAM 8 PROGRAM 8
  • 76.  3. There are no programs on either side of the freed space: PROGRAM 6 PROGRAM 5 PROGRAM 5 PROGRAM 8 PROGRAM 8
  • 77.  Let’s look at the implications of each of these cases in terms of what the Memory Manager has to do to remember the FREE and BUSY memory spaces.
  • 78.  1. There are programs either side of the freed space: PROGRAM 3 PROGRAM 4 PROGRAM 6 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 5 PROGRAM 8 PROGRAM 8
  • 79.  1. There are programs either side of the freed space: PROGRAM 3 PROGRAM 4 PROGRAM 6 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 5 PROGRAM 8 PROGRAM 8 250-300 315-340 300-315 200-250 355-380 340-355 250-300 315-340 300-315 200-250 355-380 340-355
  • 80.  1. There are programs either side of the freed space: 250-300 315-340 300-315 200-250 355-380 340-355 250-300 315-340 300-315 200-250 355-380 340-355 Starts Size Status 200 50 BUSY 250 50 BUSY 300 15 BUSY 315 25 BUSY 340 15 FREE 355 25 BUSY Starts Size Status 200 50 BUSY 250 50 BUSY 300 15 FREE 315 25 BUSY 340 15 FREE 355 25 BUSY
  • 81.  2. There are is a program on one side, and it’s free on the other side of the freed space: PROGRAM 3 PROGRAM 6 PROGRAM 3 PROGRAM 5 PROGRAM 5 PROGRAM 8 PROGRAM 8
  • 82.  2. There are is a program on one side, and it’s free on the other side of the freed space: PROGRAM 3 PROGRAM 6 PROGRAM 3 PROGRAM 5 PROGRAM 5 PROGRAM 8 PROGRAM 8 250-300 300-315 200-250 355-380 315-355 250-300 200-250 355-380 300-355
  • 83.  2. There are is a program on one side, and it’s free on the other side of the freed space: 250-300 300-315 200-250 355-380 315-355 250-300 200-250 355-380 300-355 Starts Size Status 200 50 BUSY 250 50 BUSY 300 15 BUSY 315 40 FREE 355 25 BUSY Starts Size Status 200 50 BUSY 250 50 BUSY 300 15 FREE 315 40 FREE 355 25 BUSY
  • 84.  2. There are is a program on one side, and it’s free on the other side of the freed space: Starts Size Status 200 50 BUSY 250 50 BUSY 300 15 BUSY 315 40 FREE 355 25 BUSY Starts Size Status 200 50 BUSY 250 50 BUSY 300 15 FREE 315 40 FREE 355 25 BUSY
  • 85.  2. There are is a program on one side, and it’s free on the other side of the freed space: Starts Size Status 200 50 BUSY 250 50 BUSY 300 15 BUSY 315 40 FREE 355 25 BUSY Starts Size Status 200 50 BUSY 250 50 BUSY 300 15 FREE 315 40 FREE 355 25 BUSY Starts Size Status 200 50 BUSY 250 50 BUSY 300 55 FREE 355 25 BUSY
  • 86.  3. There are no programs on either side of the freed space: PROGRAM 6 PROGRAM 5 PROGRAM 5 PROGRAM 8 PROGRAM 8
  • 87.  3. There are no programs on either side of the freed space: PROGRAM 6 PROGRAM 5 PROGRAM 5 PROGRAM 8 PROGRAM 8 250-300 300-315 200-250 355-380 315-355 250-355 200-250 355-380
  • 88.  3. There are no programs on either side of the freed space: 250-300 300-315 200-250 355-380 315-355 250-355 200-250 355-380 Starts Size Status 200 50 BUSY 250 50 FREE 300 15 BUSY 315 40 FREE 355 25 BUSY Starts Size Status 200 50 BUSY 250 50 FREE 300 15 FREE 315 40 FREE 355 25 BUSY
  • 89.  3. There are no programs on either side of the freed space: Starts Size Status 200 50 BUSY 250 50 FREE 300 15 BUSY 315 40 FREE 355 25 BUSY Starts Size Status 200 50 BUSY 250 50 FREE 300 15 FREE 315 40 FREE 355 25 BUSY
  • 90.  3. There are no programs on either side of the freed space: Starts Size Status 200 50 BUSY 250 50 FREE 300 15 BUSY 315 40 FREE 355 25 BUSY Starts Size Status 200 50 BUSY 250 50 FREE 300 15 FREE 315 40 FREE 355 25 BUSY Starts Size Status 200 50 BUSY 250 105 FREE 355 25 BUSY