SlideShare a Scribd company logo
1 of 7
Download to read offline
6
Memory Management
Prepared By: Ghayour Abbas
Definition
Memory Management is the process of controlling and coordinating
computer memory, assigning portions known as blocks to various running
programs to optimize the overall performance of the system.
It is the most important function of an operating system that manages
primary memory. It helps processes to move back and forward between the
main memory and execution disk. It helps OS to keep track of every memory
location, irrespective of whether it is allocated to some process or it remains
free.
Why Use Memory Management?
Here, are reasons for using memory management:
• It allows you to check how much memory needs to be allocated to
processes that decide which processor should get memory at what
time.
• Tracks whenever inventory gets freed or unallocated. According to it
will update the status.
• It allocates the space to application routines.
• It also make sure that these applications do not interfere with each
other.
• Helps protect different processes from each other
• It places the programs in memory so that memory is utilized to its full
extent.
Memory Management Techniques
Here, are some most crucial memory management techniques:
Single Contiguous Allocation
It is the easiest memory management technique. In this method, all types of
computer’s memory except a small portion which is reserved for the OS is
available for one application. For example, MS-DOS operating system
allocates memory in this way. An embedded system also runs on a single
application.
Partitioned Allocation
It divides primary memory into various memory partitions, which is mostly
contiguous areas of memory. Every partition stores all the information for a
specific task or job. This method consists of allotting a partition to a job
when it starts & unallocate when it ends.
Paged Memory Management
This method divides the computer’s main memory into fixed-size units
known as page frames. This hardware memory management unit maps
pages into frames which should be allocated on a page basis.
Segmented Memory Management
Segmented memory is the only memory management method that does not
provide the user’s program with a linear and contiguous address space.
Segments need hardware support in the form of a segment table. It contains
the physical address of the section in memory, size, and other data like
access protection bits and status.
What is Swapping?
Swapping is a method in which the process should be swapped temporarily
from the main memory to the backing store. It will be later brought back
into the memory for continue execution.
Backing store is a hard disk or some other secondary storage device that
should be big enough inorder to accommodate copies of all memory images
for all users. It is also capable of offering direct access to these memory
images.
Benefits of Swapping
Here, are major benefits/pros of swapping:
• It offers a higher degree of multiprogramming.
• Allows dynamic relocation. For example, if address binding at
execution time is being used, then processes can be swap in different
locations. Else in case of compile and load time bindings, processes
should be moved to the same location.
• It helps to get better utilization of memory.
• Minimum wastage of CPU time on completion so it can easily be
applied to a priority-based scheduling method to improve its
performance.
What is Memory allocation?
• Memory allocation is a process by which computer programs are
assigned memory or space.
• Here, main memory is divided into two types of partitions
o Low Memory – Operating system resides in this type of memory.
o High Memory– User processes are held in high memory.
Partition Allocation
Memory is divided into different blocks or partitions. Each process is
allocated according to the requirement. Partition allocation is an ideal
method to avoid internal fragmentation.
Below are the various partition allocation schemes :
• First Fit: In this type fit, the partition is allocated, which is the first
sufficient block from the beginning of the main memory.
• Best Fit: It allocates the process to the partition that is the first
smallest partition among the free partitions.
• Worst Fit: It allocates the process to the partition, which is the largest
sufficient freely available partition in the main memory.
• Next Fit: It is mostly similar to the first Fit, but this Fit, searches for the
first sufficient partition from the last allocation point.
What is Paging?
Paging is a storage mechanism that allows OS to retrieve processes from the
secondary storage into the main memory in the form of pages. In the Paging
method, the main memory is divided into small fixed-size blocks of physical
memory, which is called frames. The size of a frame should be kept the same
as that of a page to have maximum utilization of the main memory and to
avoid external fragmentation. Paging is used for faster access to data, and it
is a logical concept.
What is Fragmentation?
Processes are stored and removed from memory, which creates free
memory space, which are too small to use by other processes.
After sometimes, that processes not able to allocate to memory blocks
because its small size and memory blocks always remain unused is called
fragmentation. This type of problem happens during a dynamic memory
allocation system when free blocks are quite small, so it is not able to fulfill
any request.
Two types of Fragmentation methods are:
1. External fragmentation
2. Internal fragmentation
• External fragmentation can be reduced by rearranging memory contents
to place all free memory together in a single block.
• The internal fragmentation can be reduced by assigning the smallest
partition, which is still good enough to carry the entire process.
What is Segmentation?
Segmentation method works almost similarly to paging. The only difference
between the two is that segments are of variable-length, whereas, in the
paging method, pages are always of fixed size.
A program segment includes the program’s main function, data structures,
utility functions, etc. The OS maintains a segment map table for all the
processes. It also includes a list of free memory blocks along with its size,
segment numbers, and its memory locations in the main memory or virtual
memory.
What is Dynamic Loading?
Dynamic loading is a routine of a program which is not loaded until the
program calls it. All routines should be contained on disk in a relocatable
load format. The main program will be loaded into memory and will be
executed. Dynamic loading also provides better memory space utilization.
What is Dynamic Linking?
Linking is a method that helps OS to collect and merge various modules of
code and data into a single executable file. The file can be loaded into
memory and executed. OS can link system-level libraries into a program that
combines the libraries at load time. In Dynamic linking method, libraries are
linked at execution time, so program code size can remain small.
Difference Between Static and Dynamic Loading
Static Loading Dynamic Loading
Static loading is used when you want to load
your program statically. Then at the time of
compilation, the entire program will be
linked and compiled without need of any
external module or program dependency.
In a Dynamically loaded program,
references will be provided and the loading
will be done at the time of execution.
At loading time, the entire program is loaded
into memory and starts its execution.
Routines of the library are loaded into
memory only when they are required in the
program.
Difference Between Static and Dynamic Linking
Here, are main difference between Static vs. Dynamic Linking:
Static Linking Dynamic Linking
Static linking is used to combine all
other modules, which are required by a
program into a single executable code.
This helps OS prevent any runtime
dependency.
When dynamic linking is used, it does not need
to link the actual module or library with the
program. Instead of it use a reference to the
dynamic module provided at the time of
compilation and linking.

More Related Content

What's hot

Software Engineering CS-504 Handouts
Software Engineering   CS-504 HandoutsSoftware Engineering   CS-504 Handouts
Software Engineering CS-504 HandoutsSohaib Danish
 
Real Time Software Design in Software Engineering SE13
Real Time Software Design in Software Engineering SE13Real Time Software Design in Software Engineering SE13
Real Time Software Design in Software Engineering SE13koolkampus
 
24. Advanced Transaction Processing in DBMS
24. Advanced Transaction Processing in DBMS24. Advanced Transaction Processing in DBMS
24. Advanced Transaction Processing in DBMSkoolkampus
 
Introduction to system analysis and design
Introduction to system analysis and designIntroduction to system analysis and design
Introduction to system analysis and designTwene Peter
 
Introduction To Software Concepts Unit 1 & 2
Introduction To Software Concepts Unit 1 & 2Introduction To Software Concepts Unit 1 & 2
Introduction To Software Concepts Unit 1 & 2Raj vardhan
 
Architectural Design in Software Engineering SE10
Architectural Design in Software Engineering SE10Architectural Design in Software Engineering SE10
Architectural Design in Software Engineering SE10koolkampus
 
Software archiecture lecture04
Software archiecture   lecture04Software archiecture   lecture04
Software archiecture lecture04Luktalja
 
Functions of the Operating System
Functions of the Operating SystemFunctions of the Operating System
Functions of the Operating Systemandyr91
 
Socio Technical Systems in Software Engineering SE2
Socio Technical Systems in Software Engineering SE2Socio Technical Systems in Software Engineering SE2
Socio Technical Systems in Software Engineering SE2koolkampus
 
Legacy Systems in Software Engineering SE26
Legacy Systems in Software Engineering SE26Legacy Systems in Software Engineering SE26
Legacy Systems in Software Engineering SE26koolkampus
 
Chapter 4 software design
Chapter 4  software designChapter 4  software design
Chapter 4 software designCliftone Mullah
 
VTU 5TH SEM CSE SOFTWARE ENGINEERING SOLVED PAPERS - JUN13 DEC13 JUN14 DEC14 ...
VTU 5TH SEM CSE SOFTWARE ENGINEERING SOLVED PAPERS - JUN13 DEC13 JUN14 DEC14 ...VTU 5TH SEM CSE SOFTWARE ENGINEERING SOLVED PAPERS - JUN13 DEC13 JUN14 DEC14 ...
VTU 5TH SEM CSE SOFTWARE ENGINEERING SOLVED PAPERS - JUN13 DEC13 JUN14 DEC14 ...vtunotesbysree
 
21. Application Development and Administration in DBMS
21. Application Development and Administration in DBMS21. Application Development and Administration in DBMS
21. Application Development and Administration in DBMSkoolkampus
 
Introduction to Operating Systems
Introduction to Operating SystemsIntroduction to Operating Systems
Introduction to Operating SystemsShweta Shah
 
Advanced topics in software engineering
Advanced topics in software engineeringAdvanced topics in software engineering
Advanced topics in software engineeringRupesh Vaishnav
 
Strategy of software design
Strategy of software designStrategy of software design
Strategy of software designSelf-employed
 
Software design presentation
Software design presentationSoftware design presentation
Software design presentationbit allahabad
 
Management information system software
Management information system softwareManagement information system software
Management information system softwareOnline
 

What's hot (20)

Software Engineering CS-504 Handouts
Software Engineering   CS-504 HandoutsSoftware Engineering   CS-504 Handouts
Software Engineering CS-504 Handouts
 
Real Time Software Design in Software Engineering SE13
Real Time Software Design in Software Engineering SE13Real Time Software Design in Software Engineering SE13
Real Time Software Design in Software Engineering SE13
 
24. Advanced Transaction Processing in DBMS
24. Advanced Transaction Processing in DBMS24. Advanced Transaction Processing in DBMS
24. Advanced Transaction Processing in DBMS
 
Introduction to system analysis and design
Introduction to system analysis and designIntroduction to system analysis and design
Introduction to system analysis and design
 
Introduction To Software Concepts Unit 1 & 2
Introduction To Software Concepts Unit 1 & 2Introduction To Software Concepts Unit 1 & 2
Introduction To Software Concepts Unit 1 & 2
 
Architectural Design in Software Engineering SE10
Architectural Design in Software Engineering SE10Architectural Design in Software Engineering SE10
Architectural Design in Software Engineering SE10
 
Software archiecture lecture04
Software archiecture   lecture04Software archiecture   lecture04
Software archiecture lecture04
 
Functions of the Operating System
Functions of the Operating SystemFunctions of the Operating System
Functions of the Operating System
 
Socio Technical Systems in Software Engineering SE2
Socio Technical Systems in Software Engineering SE2Socio Technical Systems in Software Engineering SE2
Socio Technical Systems in Software Engineering SE2
 
Legacy Systems in Software Engineering SE26
Legacy Systems in Software Engineering SE26Legacy Systems in Software Engineering SE26
Legacy Systems in Software Engineering SE26
 
Chapter 4 software design
Chapter 4  software designChapter 4  software design
Chapter 4 software design
 
VTU 5TH SEM CSE SOFTWARE ENGINEERING SOLVED PAPERS - JUN13 DEC13 JUN14 DEC14 ...
VTU 5TH SEM CSE SOFTWARE ENGINEERING SOLVED PAPERS - JUN13 DEC13 JUN14 DEC14 ...VTU 5TH SEM CSE SOFTWARE ENGINEERING SOLVED PAPERS - JUN13 DEC13 JUN14 DEC14 ...
VTU 5TH SEM CSE SOFTWARE ENGINEERING SOLVED PAPERS - JUN13 DEC13 JUN14 DEC14 ...
 
21. Application Development and Administration in DBMS
21. Application Development and Administration in DBMS21. Application Development and Administration in DBMS
21. Application Development and Administration in DBMS
 
Computer Sided Software Engineering
Computer Sided Software EngineeringComputer Sided Software Engineering
Computer Sided Software Engineering
 
Introduction to Operating Systems
Introduction to Operating SystemsIntroduction to Operating Systems
Introduction to Operating Systems
 
Advanced topics in software engineering
Advanced topics in software engineeringAdvanced topics in software engineering
Advanced topics in software engineering
 
Strategy of software design
Strategy of software designStrategy of software design
Strategy of software design
 
Brilient login system
Brilient login systemBrilient login system
Brilient login system
 
Software design presentation
Software design presentationSoftware design presentation
Software design presentation
 
Management information system software
Management information system softwareManagement information system software
Management information system software
 

Similar to CSI-503 - 6. Memory Management

Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OSKumar Pritam
 
Memory Managementgggffffffffffgggggggggg
Memory ManagementgggffffffffffggggggggggMemory Managementgggffffffffffgggggggggg
Memory ManagementgggffffffffffggggggggggBHUPESHRAHANGDALE200
 
memory managment on computer science.ppt
memory managment on computer science.pptmemory managment on computer science.ppt
memory managment on computer science.pptfootydigarse
 
MEMORY MANAGEMENT FHES har ar mahaadev.pptx
MEMORY MANAGEMENT FHES har ar mahaadev.pptxMEMORY MANAGEMENT FHES har ar mahaadev.pptx
MEMORY MANAGEMENT FHES har ar mahaadev.pptx22bec032
 
Memory management Assignment Help
Memory management Assignment HelpMemory management Assignment Help
Memory management Assignment HelpJosephErin
 
Paging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementPaging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementkazim Hussain
 
Memory Management in Operating System
Memory Management in Operating SystemMemory Management in Operating System
Memory Management in Operating Systemijtsrd
 
Memory management ppt
Memory management pptMemory management ppt
Memory management pptManishaJha43
 
Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management Shashank Asthana
 
OPERATING SYSTEM BY DR .MUGABO MG MKAMA
OPERATING SYSTEM BY DR .MUGABO MG MKAMAOPERATING SYSTEM BY DR .MUGABO MG MKAMA
OPERATING SYSTEM BY DR .MUGABO MG MKAMAMugabo Mkama
 

Similar to CSI-503 - 6. Memory Management (20)

Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
unit5_os (1).pptx
unit5_os (1).pptxunit5_os (1).pptx
unit5_os (1).pptx
 
Memory Managementgggffffffffffgggggggggg
Memory ManagementgggffffffffffggggggggggMemory Managementgggffffffffffgggggggggg
Memory Managementgggffffffffffgggggggggg
 
memory managment on computer science.ppt
memory managment on computer science.pptmemory managment on computer science.ppt
memory managment on computer science.ppt
 
Memory management
Memory managementMemory management
Memory management
 
UNIT-2 OS.pptx
UNIT-2 OS.pptxUNIT-2 OS.pptx
UNIT-2 OS.pptx
 
MEMORY MANAGEMENT FHES har ar mahaadev.pptx
MEMORY MANAGEMENT FHES har ar mahaadev.pptxMEMORY MANAGEMENT FHES har ar mahaadev.pptx
MEMORY MANAGEMENT FHES har ar mahaadev.pptx
 
Dynamic loading
Dynamic loadingDynamic loading
Dynamic loading
 
Memory management Assignment Help
Memory management Assignment HelpMemory management Assignment Help
Memory management Assignment Help
 
Opetating System Memory management
Opetating System Memory managementOpetating System Memory management
Opetating System Memory management
 
Module 4 memory management
Module 4 memory managementModule 4 memory management
Module 4 memory management
 
Paging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementPaging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory management
 
Memory Management in Operating System
Memory Management in Operating SystemMemory Management in Operating System
Memory Management in Operating System
 
Os unit 2
Os unit 2Os unit 2
Os unit 2
 
Memory management ppt
Memory management pptMemory management ppt
Memory management ppt
 
Operating system
Operating systemOperating system
Operating system
 
Os unit 3
Os unit 3Os unit 3
Os unit 3
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management
 
OPERATING SYSTEM BY DR .MUGABO MG MKAMA
OPERATING SYSTEM BY DR .MUGABO MG MKAMAOPERATING SYSTEM BY DR .MUGABO MG MKAMA
OPERATING SYSTEM BY DR .MUGABO MG MKAMA
 

More from ghayour abbas

Web Development 4 (HTML & CSS)
Web Development 4 (HTML & CSS)Web Development 4 (HTML & CSS)
Web Development 4 (HTML & CSS)ghayour abbas
 
Web Development 3 (HTML & CSS)
Web Development 3  (HTML & CSS)Web Development 3  (HTML & CSS)
Web Development 3 (HTML & CSS)ghayour abbas
 
Web Development 2 (HTML & CSS)
Web Development 2 (HTML & CSS)Web Development 2 (HTML & CSS)
Web Development 2 (HTML & CSS)ghayour abbas
 
Web Development 1 (HTML & CSS)
Web Development 1 (HTML & CSS)Web Development 1 (HTML & CSS)
Web Development 1 (HTML & CSS)ghayour abbas
 
CSI-503 - 13. Scheduler and Dispatcher
CSI-503 - 13. Scheduler and Dispatcher CSI-503 - 13. Scheduler and Dispatcher
CSI-503 - 13. Scheduler and Dispatcher ghayour abbas
 
CSI-503 - 11.Distributed Operating System
CSI-503 - 11.Distributed Operating SystemCSI-503 - 11.Distributed Operating System
CSI-503 - 11.Distributed Operating Systemghayour abbas
 
SWE-401 - 10. Software Testing Overview
SWE-401 - 10. Software Testing OverviewSWE-401 - 10. Software Testing Overview
SWE-401 - 10. Software Testing Overviewghayour abbas
 
SWE-401 - 9. Software Implementation
SWE-401 - 9. Software ImplementationSWE-401 - 9. Software Implementation
SWE-401 - 9. Software Implementationghayour abbas
 
SWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface DesignSWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface Designghayour abbas
 
SWE-401 - 5. Software Design Basics
SWE-401 - 5. Software Design BasicsSWE-401 - 5. Software Design Basics
SWE-401 - 5. Software Design Basicsghayour abbas
 
SWE-401 - 4. Software Requirement Specifications
SWE-401 - 4. Software Requirement Specifications SWE-401 - 4. Software Requirement Specifications
SWE-401 - 4. Software Requirement Specifications ghayour abbas
 
SWE-401 - 3. Software Project Management
SWE-401 - 3. Software Project ManagementSWE-401 - 3. Software Project Management
SWE-401 - 3. Software Project Managementghayour abbas
 
CSI-503 - 4. Process synchronization
CSI-503 - 4. Process synchronizationCSI-503 - 4. Process synchronization
CSI-503 - 4. Process synchronizationghayour abbas
 
CSI-503 - 1. Introduction to Operating system
CSI-503 - 1. Introduction to Operating systemCSI-503 - 1. Introduction to Operating system
CSI-503 - 1. Introduction to Operating systemghayour abbas
 
CSI-503 - 10. Security & Protection (Operating System)
CSI-503 - 10. Security & Protection (Operating System) CSI-503 - 10. Security & Protection (Operating System)
CSI-503 - 10. Security & Protection (Operating System) ghayour abbas
 

More from ghayour abbas (20)

TCP/IP & UDP
TCP/IP & UDPTCP/IP & UDP
TCP/IP & UDP
 
Web Development 5
Web Development 5 Web Development 5
Web Development 5
 
Web Development 4
Web Development 4Web Development 4
Web Development 4
 
Web Development 4 (HTML & CSS)
Web Development 4 (HTML & CSS)Web Development 4 (HTML & CSS)
Web Development 4 (HTML & CSS)
 
Web Development 3 (HTML & CSS)
Web Development 3  (HTML & CSS)Web Development 3  (HTML & CSS)
Web Development 3 (HTML & CSS)
 
Lab Manual CSI-321
Lab Manual CSI-321Lab Manual CSI-321
Lab Manual CSI-321
 
Web Development 2 (HTML & CSS)
Web Development 2 (HTML & CSS)Web Development 2 (HTML & CSS)
Web Development 2 (HTML & CSS)
 
Web Development 1 (HTML & CSS)
Web Development 1 (HTML & CSS)Web Development 1 (HTML & CSS)
Web Development 1 (HTML & CSS)
 
CSI-503 - 13. Scheduler and Dispatcher
CSI-503 - 13. Scheduler and Dispatcher CSI-503 - 13. Scheduler and Dispatcher
CSI-503 - 13. Scheduler and Dispatcher
 
CSI-503 - 11.Distributed Operating System
CSI-503 - 11.Distributed Operating SystemCSI-503 - 11.Distributed Operating System
CSI-503 - 11.Distributed Operating System
 
SWE-401 - 10. Software Testing Overview
SWE-401 - 10. Software Testing OverviewSWE-401 - 10. Software Testing Overview
SWE-401 - 10. Software Testing Overview
 
SWE-401 - 9. Software Implementation
SWE-401 - 9. Software ImplementationSWE-401 - 9. Software Implementation
SWE-401 - 9. Software Implementation
 
SWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface DesignSWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface Design
 
SWE-401 - 5. Software Design Basics
SWE-401 - 5. Software Design BasicsSWE-401 - 5. Software Design Basics
SWE-401 - 5. Software Design Basics
 
SWE-401 - 4. Software Requirement Specifications
SWE-401 - 4. Software Requirement Specifications SWE-401 - 4. Software Requirement Specifications
SWE-401 - 4. Software Requirement Specifications
 
SWE-401 - 3. Software Project Management
SWE-401 - 3. Software Project ManagementSWE-401 - 3. Software Project Management
SWE-401 - 3. Software Project Management
 
CSI-503 - 4. Process synchronization
CSI-503 - 4. Process synchronizationCSI-503 - 4. Process synchronization
CSI-503 - 4. Process synchronization
 
CSI-503 - 1. Introduction to Operating system
CSI-503 - 1. Introduction to Operating systemCSI-503 - 1. Introduction to Operating system
CSI-503 - 1. Introduction to Operating system
 
CSI-503 - 10. Security & Protection (Operating System)
CSI-503 - 10. Security & Protection (Operating System) CSI-503 - 10. Security & Protection (Operating System)
CSI-503 - 10. Security & Protection (Operating System)
 
11. Boolean logic
11. Boolean logic11. Boolean logic
11. Boolean logic
 

Recently uploaded

PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 

Recently uploaded (20)

PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

CSI-503 - 6. Memory Management

  • 1. 6 Memory Management Prepared By: Ghayour Abbas Definition Memory Management is the process of controlling and coordinating computer memory, assigning portions known as blocks to various running programs to optimize the overall performance of the system. It is the most important function of an operating system that manages primary memory. It helps processes to move back and forward between the main memory and execution disk. It helps OS to keep track of every memory location, irrespective of whether it is allocated to some process or it remains free. Why Use Memory Management? Here, are reasons for using memory management: • It allows you to check how much memory needs to be allocated to processes that decide which processor should get memory at what time. • Tracks whenever inventory gets freed or unallocated. According to it will update the status. • It allocates the space to application routines. • It also make sure that these applications do not interfere with each other. • Helps protect different processes from each other • It places the programs in memory so that memory is utilized to its full extent.
  • 2. Memory Management Techniques Here, are some most crucial memory management techniques: Single Contiguous Allocation It is the easiest memory management technique. In this method, all types of computer’s memory except a small portion which is reserved for the OS is available for one application. For example, MS-DOS operating system allocates memory in this way. An embedded system also runs on a single application. Partitioned Allocation It divides primary memory into various memory partitions, which is mostly contiguous areas of memory. Every partition stores all the information for a specific task or job. This method consists of allotting a partition to a job when it starts & unallocate when it ends. Paged Memory Management This method divides the computer’s main memory into fixed-size units known as page frames. This hardware memory management unit maps pages into frames which should be allocated on a page basis. Segmented Memory Management Segmented memory is the only memory management method that does not provide the user’s program with a linear and contiguous address space. Segments need hardware support in the form of a segment table. It contains the physical address of the section in memory, size, and other data like access protection bits and status.
  • 3. What is Swapping? Swapping is a method in which the process should be swapped temporarily from the main memory to the backing store. It will be later brought back into the memory for continue execution. Backing store is a hard disk or some other secondary storage device that should be big enough inorder to accommodate copies of all memory images for all users. It is also capable of offering direct access to these memory images.
  • 4. Benefits of Swapping Here, are major benefits/pros of swapping: • It offers a higher degree of multiprogramming. • Allows dynamic relocation. For example, if address binding at execution time is being used, then processes can be swap in different locations. Else in case of compile and load time bindings, processes should be moved to the same location. • It helps to get better utilization of memory. • Minimum wastage of CPU time on completion so it can easily be applied to a priority-based scheduling method to improve its performance. What is Memory allocation? • Memory allocation is a process by which computer programs are assigned memory or space. • Here, main memory is divided into two types of partitions o Low Memory – Operating system resides in this type of memory. o High Memory– User processes are held in high memory. Partition Allocation Memory is divided into different blocks or partitions. Each process is allocated according to the requirement. Partition allocation is an ideal method to avoid internal fragmentation. Below are the various partition allocation schemes : • First Fit: In this type fit, the partition is allocated, which is the first sufficient block from the beginning of the main memory. • Best Fit: It allocates the process to the partition that is the first smallest partition among the free partitions.
  • 5. • Worst Fit: It allocates the process to the partition, which is the largest sufficient freely available partition in the main memory. • Next Fit: It is mostly similar to the first Fit, but this Fit, searches for the first sufficient partition from the last allocation point. What is Paging? Paging is a storage mechanism that allows OS to retrieve processes from the secondary storage into the main memory in the form of pages. In the Paging method, the main memory is divided into small fixed-size blocks of physical memory, which is called frames. The size of a frame should be kept the same as that of a page to have maximum utilization of the main memory and to avoid external fragmentation. Paging is used for faster access to data, and it is a logical concept. What is Fragmentation? Processes are stored and removed from memory, which creates free memory space, which are too small to use by other processes. After sometimes, that processes not able to allocate to memory blocks because its small size and memory blocks always remain unused is called fragmentation. This type of problem happens during a dynamic memory allocation system when free blocks are quite small, so it is not able to fulfill any request. Two types of Fragmentation methods are: 1. External fragmentation 2. Internal fragmentation • External fragmentation can be reduced by rearranging memory contents to place all free memory together in a single block.
  • 6. • The internal fragmentation can be reduced by assigning the smallest partition, which is still good enough to carry the entire process. What is Segmentation? Segmentation method works almost similarly to paging. The only difference between the two is that segments are of variable-length, whereas, in the paging method, pages are always of fixed size. A program segment includes the program’s main function, data structures, utility functions, etc. The OS maintains a segment map table for all the processes. It also includes a list of free memory blocks along with its size, segment numbers, and its memory locations in the main memory or virtual memory. What is Dynamic Loading? Dynamic loading is a routine of a program which is not loaded until the program calls it. All routines should be contained on disk in a relocatable load format. The main program will be loaded into memory and will be executed. Dynamic loading also provides better memory space utilization. What is Dynamic Linking? Linking is a method that helps OS to collect and merge various modules of code and data into a single executable file. The file can be loaded into memory and executed. OS can link system-level libraries into a program that combines the libraries at load time. In Dynamic linking method, libraries are linked at execution time, so program code size can remain small.
  • 7. Difference Between Static and Dynamic Loading Static Loading Dynamic Loading Static loading is used when you want to load your program statically. Then at the time of compilation, the entire program will be linked and compiled without need of any external module or program dependency. In a Dynamically loaded program, references will be provided and the loading will be done at the time of execution. At loading time, the entire program is loaded into memory and starts its execution. Routines of the library are loaded into memory only when they are required in the program. Difference Between Static and Dynamic Linking Here, are main difference between Static vs. Dynamic Linking: Static Linking Dynamic Linking Static linking is used to combine all other modules, which are required by a program into a single executable code. This helps OS prevent any runtime dependency. When dynamic linking is used, it does not need to link the actual module or library with the program. Instead of it use a reference to the dynamic module provided at the time of compilation and linking.