SlideShare a Scribd company logo
Memory Management
Dr. Saeed Arif
The need for memory
management
• Memory is cheap today, and getting
cheaper
– But applications are demanding more and
more memory, there is never enough!
• Memory Management, involves allocation
and swapping blocks of data to/from
secondary storage.
• Memory I/O is slow compared to a CPU
– The OS must cleverly time the swapping to
maximise the CPU’s efficiency
Addressing
Memory Management
Requirements
• Relocation
• Protection
• Sharing
Requirements: Relocation
• The programmer does not know where the
program will be placed in memory when it
is executed,
– it may be swapped to disk and return to main
memory at a different location (relocated)
• Memory references must be translated to
the actual physical memory address
Requirements: Protection
• Processes should not be able to reference
memory locations in another process
without permission
• Impossible to check absolute addresses at
compile time
• Must be checked at run time
Requirements: Sharing
• Allow several processes to access the
same portion of memory
• Better to allow each process access to the
same copy of the program rather than
have their own separate copy
Partitioning
• An early method of managing memory
– Pre-virtual memory
– Not used much now
• But, it will clarify the later discussion of
virtual memory if we look first at
partitioning
– Virtual Memory has evolved from the
partitioning methods
Types of Partitioning
• Fixed Partitioning
• Dynamic Partitioning
• Simple Paging
• Simple Segmentation
• Virtual Memory Paging
• Virtual Memory Segmentation
Fixed Partitioning
• Equal-size partitions
– Any process whose size is less than
or equal to the partition size can be
loaded into an available partition
• The operating system can swap a
process out of a partition
Fixed Partitioning Problems
• A program may not fit in a partition.
– The programmer must design the program
with overlays
• Main memory use is inefficient.
– Any program, no matter how small, occupies
an entire partition.
– This results in internal fragmentation.
Solution – Unequal Size
Partitions
• Lessens both problems
– but doesn’t solve completely
Placement Algorithm
• Equal-size
– Placement is trivial (no options)
• Unequal-size
– Can assign each process to the smallest
partition within which it will fit
– Queue for each partition
– Processes are assigned in such a way as to
minimize wasted memory within a partition
Fixed Partitioning
Remaining Problems with
Fixed Partitions
• The number of active processes is limited
by the system
– I.E limited by the pre-determined number of
partitions
• A large number of very small process will
not use the space efficiently
– In either fixed or variable length partition
methods
Dynamic Partitioning
• Partitions are of variable length and
number
• Process is allocated exactly as much
memory as required
Dynamic Partitioning
Example
• External Fragmentation
• Memory external to all
processes is fragmented
• Can resolve using
compaction
– OS moves processes so
that they are contiguous
– Time consuming and
wastes CPU
time(Relocation)
OS (8M)
P1
(20M)
P2
(14M)
P3
(18M)
Empty
(56M)
Empty (4M)
P4(8M)
Empty (6M)
P2
(14M)
Empty (6M)
Refer to Figure 7.4
Dynamic Partitioning
• Operating system must decide which free
block to allocate to a process
• Best-fit algorithm
– Chooses the block that is closest in size to the
request
• Worst performer overall
• Since smallest block is found for process, the
smallest amount of fragmentation is left
– Memory compaction must be done more often
Dynamic Partitioning
• First-fit algorithm
– Scans memory form the beginning and
chooses the first available block that is large
enough
– Fastest
Dynamic Partitioning
• Next-fit
– Scans memory from the location of the last
placement
– More often allocate a block of memory at the
end of memory where the largest block is
found
– The largest block of memory is broken up into
smaller blocks
– Compaction is required to obtain a large block
at the end of memory
Allocation
Buddy System
• Entire space available is treated as a
single block of 2U
• If a request of size s where 2U-1 < s <= 2U
– entire block is allocated
• Otherwise block is split into two equal
buddies
– Process continues until smallest block greater
than or equal to s is generated
Example of Buddy System
Relocation
• When program loaded into memory the
actual (absolute) memory locations are
determined
• A process may occupy different partitions
which means different absolute memory
locations during execution
– Swapping
– Compaction
Addresses
• Logical
– Reference to a memory location independent
of the current assignment of data to memory.
• Relative
– Address expressed as a location relative to
some known point.
• Physical or Absolute
– The absolute address or actual location in
main memory.
Protection and Relocation
partition 0
partition 1
partition 2
partition 3
0
2K
6K
8K
12K
physical memory
Offset(Relative) +
Logical address
P2’s base: 6K
base register
2K
<?
no
raise
protection fault
limit register
yes
Registers Used during
Execution
• Base register
– Starting address for the process
• Bounds(limit) register
– Ending location of the process
• These values are set when the process is
loaded or when the process is swapped in
Registers Used during
Execution
• The value of the base register is added to
a relative address to produce an absolute
address
• The resulting address is compared with
the value in the bounds register
• If the address is not within bounds, an
interrupt is generated to the operating
system
Paging
• Partition memory into small equal fixed-
size chunks and divide each process into
the same size chunks
• The chunks of a process are called pages
• The chunks of memory are called frames
Paging
• Operating system maintains a page table
for each process
– Contains the frame location for each page in
the process
– Memory address consist of a page number
and offset within the page
Processes and Frames
A.0
A.1
A.2
A.3
B.0
B.1
B.2
C.0
C.1
C.2
C.3
D.0
D.1
D.2
D.3
D.4
Page Table
Segmentation
• A program can be subdivided into
segments
– Segments may vary in length
– There is a maximum segment length
• Addressing consist of two parts
– a segment number and
– an offset
• Segmentation is similar to dynamic
partitioning
Virtual Memory Management
Key points in
Memory Management
1) A process may be broken up into pieces
that do not need to located contiguously
in main memory
2) Memory references are logical addresses
dynamically translated into physical
addresses at run time
– A process may be swapped in and out of main
memory occupying different regions at
different times during execution
Breakthrough in
Memory Management
• If both of those two characteristics are
present,
– then it is not necessary that all of the pages
or all of the segments of a process be in main
memory during execution.
• If the next instruction, and the next data
location are in memory then execution can
proceed
– at least for a time
Implications of
this new strategy
• More processes may be maintained in
main memory
– Only load in some of the pieces of each
process
– With so many processes in main memory, it is
very likely a process will be in the Ready state
at any particular time
• A process may be larger than all of main
memory
Support Needed for
Virtual Memory
• Hardware must support paging and
segmentation
• Operating system must be able to manage
the movement of pages and/or segments
between secondary memory and main
memory
Paging with virtual memory
• Solve the external fragmentation problem by using fixed sized units in
both physical and virtual memory
frame 0
frame 1
frame 2
frame Y
physical address space
…
page 0
page 1
page 2
page X
virtual address space
…
page 3

More Related Content

PPT
Os Threads
PPT
Disk scheduling
PDF
Memory (Computer Organization)
PPT
Pawan111
PPTX
Cache memory
PPTX
Raid and its levels
PDF
Vliw or epic
PPTX
Cache memory ppt
Os Threads
Disk scheduling
Memory (Computer Organization)
Pawan111
Cache memory
Raid and its levels
Vliw or epic
Cache memory ppt

What's hot (20)

PPTX
contiguous memory allocation.pptx
PPTX
Cache memory principles
PPT
04 cache memory.ppt 1
PPTX
Segmentation in operating systems
PPT
CPU Scheduling Algorithms
PPT
Computer architecture pipelining
PPT
Disk scheduling
PPT
Context Switching
PPT
Input Output Operations
PPT
Distributed Deadlock Detection.ppt
PPT
Computer architecture cache memory
PPTX
Presentation on Segmentation
PPT
Cache Memory
PDF
Semaphores
PPTX
Storage management in operating system
PPTX
Computer Organisation & Architecture (chapter 1)
PPTX
Segmentation in Operating Systems.
PPTX
Semophores and it's types
PDF
Instruction code
PPT
Interprocess communication (IPC) IN O.S
contiguous memory allocation.pptx
Cache memory principles
04 cache memory.ppt 1
Segmentation in operating systems
CPU Scheduling Algorithms
Computer architecture pipelining
Disk scheduling
Context Switching
Input Output Operations
Distributed Deadlock Detection.ppt
Computer architecture cache memory
Presentation on Segmentation
Cache Memory
Semaphores
Storage management in operating system
Computer Organisation & Architecture (chapter 1)
Segmentation in Operating Systems.
Semophores and it's types
Instruction code
Interprocess communication (IPC) IN O.S
Ad

Similar to Memory management1 (20)

PDF
07-MemoryManagement.ppt
PPT
Chapter07_ds.ppt
PPT
Chap7
PDF
Memory Management
PPT
OPERATING SYSTEM IMPORTANT NOTES_UNIT-4.ppt
PPTX
B.Tech. Computer Science Engineering OS Notes Unit 3
PPT
7. Memory management in operating system.ppt
PPTX
Memory Management in Operating Systems ppt.pptx
PPTX
CS345 16 - Ch07 Memory management 1.pptx
PPT
Memory Management in Operating Systems for all
PPTX
local_media3192961381667787861026781.pptx
PPTX
OS Unit 2.pptx
PPTX
Lecture 5 memory management in operating systems.pptx
PPTX
Operating system memory management
PPT
operationg systemsdocumentmemorymanagement
PPT
OS-unit-3 part -1mxmxmxmmxmxmmxmxmxmxmxmmxmxmmx.ppt
PPTX
Memory Management in System Designing.pptx
PPTX
HW29kkkkkkkkkkkkkkkkkkkmmmmkkmmkkk454.pptx
PPT
Chapter 2 part 1
PDF
muja osjkkhkhkkhkkkfdxfdfddkhvjlbjljlhgg
07-MemoryManagement.ppt
Chapter07_ds.ppt
Chap7
Memory Management
OPERATING SYSTEM IMPORTANT NOTES_UNIT-4.ppt
B.Tech. Computer Science Engineering OS Notes Unit 3
7. Memory management in operating system.ppt
Memory Management in Operating Systems ppt.pptx
CS345 16 - Ch07 Memory management 1.pptx
Memory Management in Operating Systems for all
local_media3192961381667787861026781.pptx
OS Unit 2.pptx
Lecture 5 memory management in operating systems.pptx
Operating system memory management
operationg systemsdocumentmemorymanagement
OS-unit-3 part -1mxmxmxmmxmxmmxmxmxmxmxmmxmxmmx.ppt
Memory Management in System Designing.pptx
HW29kkkkkkkkkkkkkkkkkkkmmmmkkmmkkk454.pptx
Chapter 2 part 1
muja osjkkhkhkkhkkkfdxfdfddkhvjlbjljlhgg
Ad

More from rizwanaabassi (10)

PPTX
Deadlocks2
PPTX
PPTX
Deadlocks1
PPTX
Concurrency
PPT
Hci lecture set_03_00
PPT
Hci lecture 01_00
PPT
Oslecture1
PPTX
Data com lec1
PPT
Subnetting a class_c_address
PPTX
Pesentation of formal
Deadlocks2
Deadlocks1
Concurrency
Hci lecture set_03_00
Hci lecture 01_00
Oslecture1
Data com lec1
Subnetting a class_c_address
Pesentation of formal

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Spectroscopy.pptx food analysis technology
PDF
Encapsulation theory and applications.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
A comparative analysis of optical character recognition models for extracting...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Tartificialntelligence_presentation.pptx
PPT
Teaching material agriculture food technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Machine learning based COVID-19 study performance prediction
PDF
cuic standard and advanced reporting.pdf
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Network Security Unit 5.pdf for BCA BBA.
gpt5_lecture_notes_comprehensive_20250812015547.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Spectroscopy.pptx food analysis technology
Encapsulation theory and applications.pdf
A Presentation on Artificial Intelligence
Reach Out and Touch Someone: Haptics and Empathic Computing
Programs and apps: productivity, graphics, security and other tools
Per capita expenditure prediction using model stacking based on satellite ima...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
A comparative analysis of optical character recognition models for extracting...
“AI and Expert System Decision Support & Business Intelligence Systems”
Tartificialntelligence_presentation.pptx
Teaching material agriculture food technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Machine learning based COVID-19 study performance prediction
cuic standard and advanced reporting.pdf
SOPHOS-XG Firewall Administrator PPT.pptx

Memory management1

  • 2. The need for memory management • Memory is cheap today, and getting cheaper – But applications are demanding more and more memory, there is never enough! • Memory Management, involves allocation and swapping blocks of data to/from secondary storage. • Memory I/O is slow compared to a CPU – The OS must cleverly time the swapping to maximise the CPU’s efficiency
  • 5. Requirements: Relocation • The programmer does not know where the program will be placed in memory when it is executed, – it may be swapped to disk and return to main memory at a different location (relocated) • Memory references must be translated to the actual physical memory address
  • 6. Requirements: Protection • Processes should not be able to reference memory locations in another process without permission • Impossible to check absolute addresses at compile time • Must be checked at run time
  • 7. Requirements: Sharing • Allow several processes to access the same portion of memory • Better to allow each process access to the same copy of the program rather than have their own separate copy
  • 8. Partitioning • An early method of managing memory – Pre-virtual memory – Not used much now • But, it will clarify the later discussion of virtual memory if we look first at partitioning – Virtual Memory has evolved from the partitioning methods
  • 9. Types of Partitioning • Fixed Partitioning • Dynamic Partitioning • Simple Paging • Simple Segmentation • Virtual Memory Paging • Virtual Memory Segmentation
  • 10. Fixed Partitioning • Equal-size partitions – Any process whose size is less than or equal to the partition size can be loaded into an available partition • The operating system can swap a process out of a partition
  • 11. Fixed Partitioning Problems • A program may not fit in a partition. – The programmer must design the program with overlays • Main memory use is inefficient. – Any program, no matter how small, occupies an entire partition. – This results in internal fragmentation.
  • 12. Solution – Unequal Size Partitions • Lessens both problems – but doesn’t solve completely
  • 13. Placement Algorithm • Equal-size – Placement is trivial (no options) • Unequal-size – Can assign each process to the smallest partition within which it will fit – Queue for each partition – Processes are assigned in such a way as to minimize wasted memory within a partition
  • 15. Remaining Problems with Fixed Partitions • The number of active processes is limited by the system – I.E limited by the pre-determined number of partitions • A large number of very small process will not use the space efficiently – In either fixed or variable length partition methods
  • 16. Dynamic Partitioning • Partitions are of variable length and number • Process is allocated exactly as much memory as required
  • 17. Dynamic Partitioning Example • External Fragmentation • Memory external to all processes is fragmented • Can resolve using compaction – OS moves processes so that they are contiguous – Time consuming and wastes CPU time(Relocation) OS (8M) P1 (20M) P2 (14M) P3 (18M) Empty (56M) Empty (4M) P4(8M) Empty (6M) P2 (14M) Empty (6M) Refer to Figure 7.4
  • 18. Dynamic Partitioning • Operating system must decide which free block to allocate to a process • Best-fit algorithm – Chooses the block that is closest in size to the request • Worst performer overall • Since smallest block is found for process, the smallest amount of fragmentation is left – Memory compaction must be done more often
  • 19. Dynamic Partitioning • First-fit algorithm – Scans memory form the beginning and chooses the first available block that is large enough – Fastest
  • 20. Dynamic Partitioning • Next-fit – Scans memory from the location of the last placement – More often allocate a block of memory at the end of memory where the largest block is found – The largest block of memory is broken up into smaller blocks – Compaction is required to obtain a large block at the end of memory
  • 22. Buddy System • Entire space available is treated as a single block of 2U • If a request of size s where 2U-1 < s <= 2U – entire block is allocated • Otherwise block is split into two equal buddies – Process continues until smallest block greater than or equal to s is generated
  • 24. Relocation • When program loaded into memory the actual (absolute) memory locations are determined • A process may occupy different partitions which means different absolute memory locations during execution – Swapping – Compaction
  • 25. Addresses • Logical – Reference to a memory location independent of the current assignment of data to memory. • Relative – Address expressed as a location relative to some known point. • Physical or Absolute – The absolute address or actual location in main memory.
  • 26. Protection and Relocation partition 0 partition 1 partition 2 partition 3 0 2K 6K 8K 12K physical memory Offset(Relative) + Logical address P2’s base: 6K base register 2K <? no raise protection fault limit register yes
  • 27. Registers Used during Execution • Base register – Starting address for the process • Bounds(limit) register – Ending location of the process • These values are set when the process is loaded or when the process is swapped in
  • 28. Registers Used during Execution • The value of the base register is added to a relative address to produce an absolute address • The resulting address is compared with the value in the bounds register • If the address is not within bounds, an interrupt is generated to the operating system
  • 29. Paging • Partition memory into small equal fixed- size chunks and divide each process into the same size chunks • The chunks of a process are called pages • The chunks of memory are called frames
  • 30. Paging • Operating system maintains a page table for each process – Contains the frame location for each page in the process – Memory address consist of a page number and offset within the page
  • 33. Segmentation • A program can be subdivided into segments – Segments may vary in length – There is a maximum segment length • Addressing consist of two parts – a segment number and – an offset • Segmentation is similar to dynamic partitioning
  • 35. Key points in Memory Management 1) A process may be broken up into pieces that do not need to located contiguously in main memory 2) Memory references are logical addresses dynamically translated into physical addresses at run time – A process may be swapped in and out of main memory occupying different regions at different times during execution
  • 36. Breakthrough in Memory Management • If both of those two characteristics are present, – then it is not necessary that all of the pages or all of the segments of a process be in main memory during execution. • If the next instruction, and the next data location are in memory then execution can proceed – at least for a time
  • 37. Implications of this new strategy • More processes may be maintained in main memory – Only load in some of the pieces of each process – With so many processes in main memory, it is very likely a process will be in the Ready state at any particular time • A process may be larger than all of main memory
  • 38. Support Needed for Virtual Memory • Hardware must support paging and segmentation • Operating system must be able to manage the movement of pages and/or segments between secondary memory and main memory
  • 39. Paging with virtual memory • Solve the external fragmentation problem by using fixed sized units in both physical and virtual memory frame 0 frame 1 frame 2 frame Y physical address space … page 0 page 1 page 2 page X virtual address space … page 3

Editor's Notes

  • #3: in a uniprogramming system, main memory is divided into two parts: one part for the operating system (resident monitor, kernel) and one part for the program currently being executed. In a multiprogramming system, the “user” part of memory must be further subdivided to accommodate multiple processes.Emphasise that memory management is vital in a multiprogramming system. If only a few processes are in memory, then for much of the time all of the processes will be waitingfor I/O and the processor will be idle.Thus memory needs to be allocated to ensure a reasonable supply of ready processes to consume available processor time.
  • #4: This figure depicts a process image. Talk the students through this diagramAssume that the process image occupies a contiguous region of main memory. The OS needs to know the location of:process control information the execution stack, the entry point to begin execution of the program for this process. Because the operating system knows this information because it is managing memory and is responsible for bringing this process into main memory. However, the processor must deal with memory references within the program. Branch instructions contain an address to reference the instruction to be executed next. Data reference instructions contain the address of the byte or word of data referenced. Somehow, the processor hardware and operating system software must be able to translate the memory references found in the code of the program into actual physical memory addresses, reflecting the current location of the program in main memory.
  • #5: The following slides expandon these topics.
  • #7: Normally, a user process cannot access any portion of the operating system, neither program nor data. Usually a program in one process cannot branch to an instruction in another process or access the data area of another process. The processor must be able to abort such instructions at the point of execution.Note that the memory protection requirement must be satisfied by the processor (hardware) rather than the operating system (software) because the OS cannot anticipate all of the memory references that a program will make. It is only possible to assess the permissibility of a memory reference at the time of execution.Why is it a Bad Thing for one process to be able to read, or even write, to memory occupied by a different process?Why is it impossible to check absolute addresses at compile time (hint: see relocation)
  • #8: Any protection mechanism must have the flexibility to allow several processes to access the same portion of main memory. Processes that are cooperating on some task may need to share access to the same data structure.
  • #10: Don’t dwell on this slide – it is just an indication on the various approaches which will be covered in further detail in other slides
  • #16: Finish by mentioning tat fixed partitioning is almost unknown today
  • #18: Animated slideImagine a system with 64M RAMInitially, main memory is empty, except for the operating system Three processes are loaded in – leaving a ‘hole’ too small for any further processAt some point, none of the processes in memory is ready. The operating system swaps out process 2, Which leaves sufficient room to load a new process, process 4 – but that creates another holeLater, a point is reached at which none of the processes in main memory is ready, but process 2, in the Ready-Suspend state, is available. Because there is insufficient room in memory for process 2, the operating system swaps process 1 out and swaps process 2 back in leaving yet another holeExplain External Fragmentation and compaction – mention that compaction implies the capability of dynamic relocation
  • #22: Slide shows Fig 7.5 - an example memory configuration after a number of placement and swapping-out operations. The last block that was used was a 22-Mbyte block from which a 14-Mbyte partition was created. Figure 7.5b shows the difference between the best, first, and next-fit placement algorithms in satisfying a 16-Mbyte allocation request.Best-fit will search the entire list of available blocks and make use of the 18-Mbyte block, leaving a 2-Mbyte fragment.First-fit results in a 6-Mbyte fragment, and Next-fit results in a 20-Mbyte fragment.
  • #23: In a fixed partitioning scheme limits the number of active processes and may use space inefficiently if there is a poor match between available partition sizes and process sizes.A dynamic partitioning scheme is more complex to maintain and includes the overhead of compaction.An interesting compromise is the buddy system.
  • #24: Figure 7.6 gives an example using a 1-Mbyte initial block.The first request,A, is for 100 Kbytes, for which a 128K block is needed.The initial block is divided into two 512K buddies.The first of these is divided into two 256K buddies, and the first of these is divided into two 128K buddies, one of which is allocated to A.The next request,B, requires a 256K block. Such a block is already available and is allocated. The process continues with splitting and coalescing occurring as needed.Note that when E is released,two 128K buddies are coalesced into a 256K block, which is immediately coalesced with its buddy
  • #26: means that the address the program sees is different from the physical address of the data being stored in RAM.translation must be made from both Logical and Relative addresses to arrive at the Absolute address
  • #32: Animated slideSystem with a number of frames allocatedProcess A, stored on disk, consists of four pages. When it comes time to load this process, the operating system finds four free frames and loads the four pages of process A into the four frames.Process B, consisting of three pages, and process C, consisting of four pages, are subsequently loaded.Then process B is suspended and is swapped out of main memory. Later, all of the processes in main memory are blocked, and the operating system needs to bring in a new process, process D, which consists of five pages. The Operating System loads the pages into the available frames and updates the page table
  • #34: The difference with dynamic partitioning, is that with segmentation a program may occupy more than one partition, and these partitions need not be contiguous.Segmentation eliminates internal fragmentation but suffers from external fragmentation (as does dynamic partitioning)However, because a process is broken up into a number of smaller pieces, the external fragmentation should be less.A consequence of unequal-size segments is that there is no simple relationship between logical addresses and physical addresses. Analogous to paging, a simple segmentation scheme would make use of a segment table for each process and a list of free blocks of main memory. Each segment table entry would have to give the starting address in main memory of the corresponding segment. the length of the segment, to assure that invalid addresses are not used.When a process enters the Running state, the address of its segment table is loaded into a special register used by the memory management hardware.
  • #36: Two characteristics of paging and segmentation are the keys to this breakthrough in memory management:All memory references within a process are logical addresses that are dynamically translated into physical addresses at run time.A process may be swapped in and out of main memory occupying different regions of main memory at different times during the course of execution.2. A process may be broken up into a number of pieces (pages or segments) and these pieces need not be contiguously located in main memory during execution.The combination of dynamic run-time address translation and the use of a page or segment table permits this.
  • #37: If the piece (segment or page) that holds the next instruction to be fetched and the piece that holds the next data location to be accessed are in main memory, then execution may proceed (at least for a time).
  • #38: More processes may be maintained in main memory. Because we are only going to load some of the pieces of any particular process, there is room for more processes. This leads to more efficient utilization of the processor because it is more likely that at least one of the more numerous processes will be in a Ready state at any particular time.2. A process may be larger than all of main memory. Without the scheme a programmer must be acutely aware of how much memory is available. If the program being written is too large, the programmer must devise ways to structure the program into pieces that can be loaded separately in some sort of overlay strategy. With virtual memory based on paging or segmentation, that job is left to the operating system and the hardware. As far as the programmer is concerned, he or she is dealing with a huge memory, the size associated with disk storage.The operating system automatically loads pieces of a process into main memory as required.
  • #39: For virtual memory to be practical and effective, two ingredients are needed. there must be hardware support for the paging and/or segmentation scheme to be employed. the operating system must include software for managing the movement of pages and/or segments between secondary memoryand main memory.