SlideShare uma empresa Scribd logo
1 de 23
At the end of this chapter, students will be able to:
1)Identify between resident and transient routines
2)Explain the following terminology:
Memory management is concerned with managing:
1)The computer’s available pool of memory
2)Allocating space to application routines and making
  sure that they do not interfere with each other.
•    The operating system is a collection of software
     routines.
    Resident routines             Transient routines
    Routines that directly        Stored on disk and read
    support application           into memory only when
    programs as they run          needed
    Example: routine that control Example: routine that
    physical I/O                  formats disks
• Generally, the operating system
occupies low memory beginning
with address 0.
• Key control information comes
first followed by the various
resident operating system
routines.
•The remaining memory, called
the transient area, is
where application programs and
transient operating system
routines are loaded.
                                    Resident & transient routines
                                             structure
   The simplest approach to managing memory for
    multiple, concurrent programs.


                                On many systems,
                                multiple
                                programs are loaded into
                                memory and executed
                                concurrently.
   Divides the available space into fixed-length partitions,
    each of which holds one program.
   Partition sizes are generally set when the system is
    initially started, so the memory allocation decision is
    made before the actual amount of space needed by a
    given program is known.
   Advantages:
    - Its major advantage is simplicity
   Disadvantages:
    - Because the size of a partition must be big enough to hold the
      largest program that is likely to be loaded, fixed-partition
      memory management wastes space
Fixed-partition
memory
management divides
the available space
into fixed length
partitions each of
which holds one
program.


                         Fixed-partition memory
                      management structure diagram
   Under dynamic memory management, the transient area
    is treated as a pool of unstructured free space.
   When the system decides to load a particular program, a
    region of memory just sufficient to hold the program is
    allocated from the pool.
   Advantages:
     - Because a program gets only the space it needs relatively little is
       wasted.
   However, dynamic memory management does not
    completely solve the wasted space problem.

   Fragmentation (bits of unused space spread throughout
    memory) is a possible problem.
   3 algorithm for searching free block for a specific amount
    of memory:

1) First fit
    - Allocate the first free block that is large enough for the new
      process.
    - This a fast algorithm.
2) Best fit
    - Allocate the smallest block among those that are large enough for
      the new process.
    - OS search entire list, or it can keep it sorted and stop it when it
      has an entry which has a size larger than the size of process.
    - This algorithm produces the smallest left over block.
3) Worst fit
    - Allocate the largest block among those that are large enough for
      the new process.
    - Search or sorting of the entire list is needed.
    - This algorithm produces the largest left over block.


   Compaction:
    - Method to overcome the external fragmentation problem.
    - All free blocks are brought together as one large block of free
      space.
   Assume, for example, that a 640K
    program has just finished executing.
-   If there are no 640K programs
    available, the system
    might load a 250K program and a
    300K program, but note that 90K
    remains unallocated.
-   If there are no 90K or smaller
    programs available, the space will
    simply not be used.
-   Over time, little chunks of unused
    space will be spread throughout
    memory, creating a fragmentation
    problem.
   With segmentation, programs
    are divided into variable size
    segments, instead of fixed size
    pages.
   Every logical address is formed
    of a segment name and an offset
    within that segment.
   In practice, segments are
    numbered.
   Programs are segmented
    automatically by compiler or
    assembler.
  For logical to physical address mapping, a
   segment table is used.
 When a logical address <s, d> is generated by
   processor:
1) Base and limit values corresponding to segment s
   are determined using the segment table.
2) The OS checks whether d is in the limit.
   ( 0=<limit)
3) If so, then the physical address is calculated as
   ( based + d), and the memory is accessed.
Dynamic address
        translation.
To dynamically translate a
segment address to an
absolute address:
1) Break the address into
segment
and displacement portions
2) Use the segment
number to find the
segment’s absolute entry
point
address in a program
segment table
3) Add the displacement to
the entry point address.
 A program’s segments can vary in length.
  Under paging, a program is broken into fixed-length
  pages. Page size is generally small (perhaps 2K to 4K), and
  chosen with hardware efficiency in mind.
 Like segments, a program’s pages are loaded into
  noncontiguous memory.
 Addresses consist of two parts , a page number in the
  high-order positions and a displacement in the low-order
  bits.
 Addresses are dynamically translated as the program
  runs. When an instruction is fetched, its base-plus
  displacement addresses are expanded to absolute
  addresses by hardware.
 Then the page’s base address is looked up in a program
  page table (like the segment table, maintained by the
  operating system) and added to the displacement.
    Advantages:
1)   Address translation: each task has the same virtual address
2)   Address translation: turns fragmented physical addresses
     into contiguous virtual addresses
3)   Memory protection (buggy or malicious tasks can't harm
     each other or the kernel)
4)   Demand loading (prevents big load on CPU when a task first
     starts running, conserves memory)
5)   Memory mapped files
6)   Virtual memory swapping (lets system degrade gracefully
     when memory required exceeds RAM size)
1) With segmentation and paging, addresses are divided
  into a segment number, a page number within that
  segment, and a displacement within that page.
2) After the instruction control unit expands the relative
  address, dynamic address translation begins.
3) First, the program’s segment table is searched for the
  segment number, which yields the address of the
  segment’s page table.
4) The page table is then searched for the page’s base
  address, which is added to the displacement to get an
  absolute address.
   The word virtual means “not in actual fact.”
   To the programmer or user, virtual memory acts just
    like real memory, but it isn’t real memory.
   Virtual memory is a model that holds space for the
    operating system and several application programs.
   The operating system and selected pages occupy real
    memory.
    Application programs are stored on an external
    paging device.
    Virtual memory is a model that simplifies address
     translation. It “contains” the operating system and all
     the application programs, but it does not physically
     exist anywhere.
     Its contents are physically stored in real memory and
     on the external paging device.
    Divided into two components.
1)   First components
-    The first is exactly equal to the amount of real memory
     on the system and is physically stored in real memory.
-    It contains the resident operating system and the
     transient program area (called the page pool).
2) Second components
-   The second component of virtual memory consists of
    space over and above real memory capacity.
-   It is physically stored on the external paging device
    and contains the application programs.
-   The operating system is loaded into real memory.
-   Application programs are loaded onto the external
    paging device.
-   Selected pages are then swapped between the real
    memory page pool and the external paging device

Mais conteúdo relacionado

Mais procurados

Pengertian data dan maklumat
Pengertian data dan maklumatPengertian data dan maklumat
Pengertian data dan maklumatmohdfirdaus360
 
KONSEP PANGKALAN DATA (DBMS)
KONSEP PANGKALAN DATA (DBMS)KONSEP PANGKALAN DATA (DBMS)
KONSEP PANGKALAN DATA (DBMS)Naveen Segaran
 
Structure of shared memory space
Structure of shared memory spaceStructure of shared memory space
Structure of shared memory spaceCoder Tech
 
3 komponen unit sistem
3 komponen unit sistem3 komponen unit sistem
3 komponen unit sistemwazi musa
 
Maksud & kegunaan rangkaian 2
Maksud & kegunaan rangkaian 2Maksud & kegunaan rangkaian 2
Maksud & kegunaan rangkaian 2nurulsaat
 
chapter 2 memory and process management
chapter 2 memory and process managementchapter 2 memory and process management
chapter 2 memory and process managementAisyah Rafiuddin
 
Sistem pengoperasian
Sistem pengoperasianSistem pengoperasian
Sistem pengoperasianHarries Har
 
Komponen asas komputer
Komponen asas komputerKomponen asas komputer
Komponen asas komputerLekha Lekzz
 
Computer architecture memory system
Computer architecture memory systemComputer architecture memory system
Computer architecture memory systemMazin Alwaaly
 
Kitar hayat pembangunan aturcara / sistem
Kitar hayat pembangunan aturcara / sistemKitar hayat pembangunan aturcara / sistem
Kitar hayat pembangunan aturcara / sistemNaveen Segaran
 
PErisian Sumber Terbuka vs. Perisian Sumber Tertutup
PErisian Sumber Terbuka vs. Perisian Sumber TertutupPErisian Sumber Terbuka vs. Perisian Sumber Tertutup
PErisian Sumber Terbuka vs. Perisian Sumber TertutupFarid Diah
 
Process synchronization
Process synchronizationProcess synchronization
Process synchronizationAli Ahmad
 
Isu alam sekitar (Masalah dan Penyelesaian)
Isu alam sekitar (Masalah dan Penyelesaian)Isu alam sekitar (Masalah dan Penyelesaian)
Isu alam sekitar (Masalah dan Penyelesaian)Engku Fatin
 

Mais procurados (20)

Лекція №1
Лекція №1Лекція №1
Лекція №1
 
Pengertian data dan maklumat
Pengertian data dan maklumatPengertian data dan maklumat
Pengertian data dan maklumat
 
KONSEP PANGKALAN DATA (DBMS)
KONSEP PANGKALAN DATA (DBMS)KONSEP PANGKALAN DATA (DBMS)
KONSEP PANGKALAN DATA (DBMS)
 
Structure of shared memory space
Structure of shared memory spaceStructure of shared memory space
Structure of shared memory space
 
3 komponen unit sistem
3 komponen unit sistem3 komponen unit sistem
3 komponen unit sistem
 
2.2.4 storan1
2.2.4 storan12.2.4 storan1
2.2.4 storan1
 
Sistem maklumat
Sistem maklumatSistem maklumat
Sistem maklumat
 
BAB 3 Perisian Aplikasi
BAB 3   Perisian AplikasiBAB 3   Perisian Aplikasi
BAB 3 Perisian Aplikasi
 
Maksud & kegunaan rangkaian 2
Maksud & kegunaan rangkaian 2Maksud & kegunaan rangkaian 2
Maksud & kegunaan rangkaian 2
 
chapter 2 memory and process management
chapter 2 memory and process managementchapter 2 memory and process management
chapter 2 memory and process management
 
Sistem pengoperasian
Sistem pengoperasianSistem pengoperasian
Sistem pengoperasian
 
Threads .ppt
Threads .pptThreads .ppt
Threads .ppt
 
Komponen asas komputer
Komponen asas komputerKomponen asas komputer
Komponen asas komputer
 
1.3 ancaman komputer
1.3 ancaman komputer1.3 ancaman komputer
1.3 ancaman komputer
 
Computer architecture memory system
Computer architecture memory systemComputer architecture memory system
Computer architecture memory system
 
Kitar hayat pembangunan aturcara / sistem
Kitar hayat pembangunan aturcara / sistemKitar hayat pembangunan aturcara / sistem
Kitar hayat pembangunan aturcara / sistem
 
Process threads operating system.
Process threads operating system.Process threads operating system.
Process threads operating system.
 
PErisian Sumber Terbuka vs. Perisian Sumber Tertutup
PErisian Sumber Terbuka vs. Perisian Sumber TertutupPErisian Sumber Terbuka vs. Perisian Sumber Tertutup
PErisian Sumber Terbuka vs. Perisian Sumber Tertutup
 
Process synchronization
Process synchronizationProcess synchronization
Process synchronization
 
Isu alam sekitar (Masalah dan Penyelesaian)
Isu alam sekitar (Masalah dan Penyelesaian)Isu alam sekitar (Masalah dan Penyelesaian)
Isu alam sekitar (Masalah dan Penyelesaian)
 

Destaque

11 process definition
11 process definition11 process definition
11 process definitionmyrajendra
 
Chapter 1 part 3
Chapter 1 part 3Chapter 1 part 3
Chapter 1 part 3rohassanie
 
Chapter 2 (Part 2)
Chapter 2 (Part 2) Chapter 2 (Part 2)
Chapter 2 (Part 2) rohassanie
 
Course outline FP202 - Dis 2012
Course outline FP202 - Dis 2012Course outline FP202 - Dis 2012
Course outline FP202 - Dis 2012rohassanie
 
Chapter 1 part 2
Chapter 1 part 2Chapter 1 part 2
Chapter 1 part 2rohassanie
 
Chapter 3 part 2
Chapter 3 part 2Chapter 3 part 2
Chapter 3 part 2rohassanie
 
Chapter 3 part 1
Chapter 3 part 1Chapter 3 part 1
Chapter 3 part 1rohassanie
 
Chapter 1 part 1
Chapter 1 part 1Chapter 1 part 1
Chapter 1 part 1rohassanie
 
Virtual Memory vs Cache Memory
Virtual Memory vs Cache MemoryVirtual Memory vs Cache Memory
Virtual Memory vs Cache MemoryAshik Iqbal
 
File management
File managementFile management
File managementMohd Arif
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memorysgpraju
 
Operating Systems - File Management
Operating Systems -  File ManagementOperating Systems -  File Management
Operating Systems - File ManagementDamian T. Gordon
 

Destaque (15)

Operating system
Operating systemOperating system
Operating system
 
11 process definition
11 process definition11 process definition
11 process definition
 
Chapter 1 part 3
Chapter 1 part 3Chapter 1 part 3
Chapter 1 part 3
 
Chapter 2 (Part 2)
Chapter 2 (Part 2) Chapter 2 (Part 2)
Chapter 2 (Part 2)
 
Course outline FP202 - Dis 2012
Course outline FP202 - Dis 2012Course outline FP202 - Dis 2012
Course outline FP202 - Dis 2012
 
Chapter 1 part 2
Chapter 1 part 2Chapter 1 part 2
Chapter 1 part 2
 
Chapter 3 part 2
Chapter 3 part 2Chapter 3 part 2
Chapter 3 part 2
 
Chapter 3 part 1
Chapter 3 part 1Chapter 3 part 1
Chapter 3 part 1
 
Chapter 1 part 1
Chapter 1 part 1Chapter 1 part 1
Chapter 1 part 1
 
Virtual Memory vs Cache Memory
Virtual Memory vs Cache MemoryVirtual Memory vs Cache Memory
Virtual Memory vs Cache Memory
 
File management
File managementFile management
File management
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 
File management
File managementFile management
File management
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
 
Operating Systems - File Management
Operating Systems -  File ManagementOperating Systems -  File Management
Operating Systems - File Management
 

Semelhante a Chapter 2 part 1

Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management Shashank Asthana
 
Paging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementPaging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementkazim Hussain
 
Bab 4
Bab 4Bab 4
Bab 4n k
 
Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OSC.U
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory managementrprajat007
 
Memory Managementgggffffffffffgggggggggg
Memory ManagementgggffffffffffggggggggggMemory Managementgggffffffffffgggggggggg
Memory ManagementgggffffffffffggggggggggBHUPESHRAHANGDALE200
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memoryvampugani
 
Memory management Assignment Help
Memory management Assignment HelpMemory management Assignment Help
Memory management Assignment HelpJosephErin
 
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
 
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...LeahRachael
 
Operating Systems Structure1- Explain briefly why the objectives o.pdf
Operating Systems Structure1- Explain briefly why the objectives o.pdfOperating Systems Structure1- Explain briefly why the objectives o.pdf
Operating Systems Structure1- Explain briefly why the objectives o.pdfrishabjain5053
 
virtual memory.ppt
virtual memory.pptvirtual memory.ppt
virtual memory.pptsuryansh85
 
Unit iiios Storage Management
Unit iiios Storage ManagementUnit iiios Storage Management
Unit iiios Storage Managementdonny101
 

Semelhante a Chapter 2 part 1 (20)

Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management
 
Paging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementPaging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory management
 
Bab 4
Bab 4Bab 4
Bab 4
 
Opetating System Memory management
Opetating System Memory managementOpetating System Memory management
Opetating System Memory management
 
UNIT-2 OS.pptx
UNIT-2 OS.pptxUNIT-2 OS.pptx
UNIT-2 OS.pptx
 
Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OS
 
Operating system
Operating systemOperating system
Operating system
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
unit5_os (1).pptx
unit5_os (1).pptxunit5_os (1).pptx
unit5_os (1).pptx
 
Memory Managementgggffffffffffgggggggggg
Memory ManagementgggffffffffffggggggggggMemory Managementgggffffffffffgggggggggg
Memory Managementgggffffffffffgggggggggg
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Memory management Assignment Help
Memory management Assignment HelpMemory management Assignment Help
Memory management Assignment Help
 
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
 
Chapter 2 operating systems
Chapter 2 operating systemsChapter 2 operating systems
Chapter 2 operating systems
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...
 
Operating system introduction
Operating system introductionOperating system introduction
Operating system introduction
 
Operating Systems Structure1- Explain briefly why the objectives o.pdf
Operating Systems Structure1- Explain briefly why the objectives o.pdfOperating Systems Structure1- Explain briefly why the objectives o.pdf
Operating Systems Structure1- Explain briefly why the objectives o.pdf
 
virtual memory.ppt
virtual memory.pptvirtual memory.ppt
virtual memory.ppt
 
Unit iiios Storage Management
Unit iiios Storage ManagementUnit iiios Storage Management
Unit iiios Storage Management
 

Mais de rohassanie

FP 201 - Unit 6
FP 201 - Unit 6FP 201 - Unit 6
FP 201 - Unit 6rohassanie
 
FP 201 - Unit4 Part 2
FP 201 - Unit4 Part 2FP 201 - Unit4 Part 2
FP 201 - Unit4 Part 2rohassanie
 
FP 201 - Unit 3 Part 2
FP 201 - Unit 3 Part 2FP 201 - Unit 3 Part 2
FP 201 - Unit 3 Part 2rohassanie
 
FP 202 - Chapter 5
FP 202 - Chapter 5FP 202 - Chapter 5
FP 202 - Chapter 5rohassanie
 
FP 202 Chapter 2 - Part 3
FP 202 Chapter 2 - Part 3FP 202 Chapter 2 - Part 3
FP 202 Chapter 2 - Part 3rohassanie
 
FP 201 Unit 2 - Part 3
FP 201 Unit 2 - Part 3FP 201 Unit 2 - Part 3
FP 201 Unit 2 - Part 3rohassanie
 
FP 201 Unit 2 - Part 2
FP 201 Unit 2 - Part 2FP 201 Unit 2 - Part 2
FP 201 Unit 2 - Part 2rohassanie
 
Labsheet 7 FP 201
Labsheet 7 FP 201Labsheet 7 FP 201
Labsheet 7 FP 201rohassanie
 
Labsheet 6 - FP 201
Labsheet 6 - FP 201Labsheet 6 - FP 201
Labsheet 6 - FP 201rohassanie
 
Jadual Waktu Sesi JUN 2012
Jadual Waktu Sesi JUN 2012Jadual Waktu Sesi JUN 2012
Jadual Waktu Sesi JUN 2012rohassanie
 
FP 201 Unit 3
FP 201 Unit 3 FP 201 Unit 3
FP 201 Unit 3 rohassanie
 
Labsheet2 stud
Labsheet2 studLabsheet2 stud
Labsheet2 studrohassanie
 
Labsheet1 stud
Labsheet1 studLabsheet1 stud
Labsheet1 studrohassanie
 

Mais de rohassanie (20)

FP 201 - Unit 6
FP 201 - Unit 6FP 201 - Unit 6
FP 201 - Unit 6
 
Fp201 unit5 1
Fp201 unit5 1Fp201 unit5 1
Fp201 unit5 1
 
FP 201 - Unit4 Part 2
FP 201 - Unit4 Part 2FP 201 - Unit4 Part 2
FP 201 - Unit4 Part 2
 
Fp201 unit4
Fp201 unit4Fp201 unit4
Fp201 unit4
 
FP 201 - Unit 3 Part 2
FP 201 - Unit 3 Part 2FP 201 - Unit 3 Part 2
FP 201 - Unit 3 Part 2
 
FP 202 - Chapter 5
FP 202 - Chapter 5FP 202 - Chapter 5
FP 202 - Chapter 5
 
FP 202 Chapter 2 - Part 3
FP 202 Chapter 2 - Part 3FP 202 Chapter 2 - Part 3
FP 202 Chapter 2 - Part 3
 
FP 201 Unit 2 - Part 3
FP 201 Unit 2 - Part 3FP 201 Unit 2 - Part 3
FP 201 Unit 2 - Part 3
 
FP 201 Unit 2 - Part 2
FP 201 Unit 2 - Part 2FP 201 Unit 2 - Part 2
FP 201 Unit 2 - Part 2
 
Lab ex 1
Lab ex 1Lab ex 1
Lab ex 1
 
Labsheet 7 FP 201
Labsheet 7 FP 201Labsheet 7 FP 201
Labsheet 7 FP 201
 
Labsheet 6 - FP 201
Labsheet 6 - FP 201Labsheet 6 - FP 201
Labsheet 6 - FP 201
 
Jadual Waktu Sesi JUN 2012
Jadual Waktu Sesi JUN 2012Jadual Waktu Sesi JUN 2012
Jadual Waktu Sesi JUN 2012
 
Labsheet 5
Labsheet 5Labsheet 5
Labsheet 5
 
Labsheet 4
Labsheet 4Labsheet 4
Labsheet 4
 
FP 201 Unit 3
FP 201 Unit 3 FP 201 Unit 3
FP 201 Unit 3
 
Labsheet_3
Labsheet_3Labsheet_3
Labsheet_3
 
Labsheet2 stud
Labsheet2 studLabsheet2 stud
Labsheet2 stud
 
Labsheet1 stud
Labsheet1 studLabsheet1 stud
Labsheet1 stud
 
Unit 3
Unit 3Unit 3
Unit 3
 

Último

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Último (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

Chapter 2 part 1

  • 1.
  • 2. At the end of this chapter, students will be able to: 1)Identify between resident and transient routines 2)Explain the following terminology:
  • 3. Memory management is concerned with managing: 1)The computer’s available pool of memory 2)Allocating space to application routines and making sure that they do not interfere with each other.
  • 4. The operating system is a collection of software routines. Resident routines Transient routines Routines that directly Stored on disk and read support application into memory only when programs as they run needed Example: routine that control Example: routine that physical I/O formats disks
  • 5. • Generally, the operating system occupies low memory beginning with address 0. • Key control information comes first followed by the various resident operating system routines. •The remaining memory, called the transient area, is where application programs and transient operating system routines are loaded. Resident & transient routines structure
  • 6. The simplest approach to managing memory for multiple, concurrent programs. On many systems, multiple programs are loaded into memory and executed concurrently.
  • 7. Divides the available space into fixed-length partitions, each of which holds one program.  Partition sizes are generally set when the system is initially started, so the memory allocation decision is made before the actual amount of space needed by a given program is known.  Advantages: - Its major advantage is simplicity  Disadvantages: - Because the size of a partition must be big enough to hold the largest program that is likely to be loaded, fixed-partition memory management wastes space
  • 8. Fixed-partition memory management divides the available space into fixed length partitions each of which holds one program. Fixed-partition memory management structure diagram
  • 9. Under dynamic memory management, the transient area is treated as a pool of unstructured free space.  When the system decides to load a particular program, a region of memory just sufficient to hold the program is allocated from the pool.  Advantages: - Because a program gets only the space it needs relatively little is wasted.  However, dynamic memory management does not completely solve the wasted space problem.  Fragmentation (bits of unused space spread throughout memory) is a possible problem.
  • 10. 3 algorithm for searching free block for a specific amount of memory: 1) First fit - Allocate the first free block that is large enough for the new process. - This a fast algorithm. 2) Best fit - Allocate the smallest block among those that are large enough for the new process. - OS search entire list, or it can keep it sorted and stop it when it has an entry which has a size larger than the size of process. - This algorithm produces the smallest left over block.
  • 11. 3) Worst fit - Allocate the largest block among those that are large enough for the new process. - Search or sorting of the entire list is needed. - This algorithm produces the largest left over block.  Compaction: - Method to overcome the external fragmentation problem. - All free blocks are brought together as one large block of free space.
  • 12. Assume, for example, that a 640K program has just finished executing. - If there are no 640K programs available, the system might load a 250K program and a 300K program, but note that 90K remains unallocated. - If there are no 90K or smaller programs available, the space will simply not be used. - Over time, little chunks of unused space will be spread throughout memory, creating a fragmentation problem.
  • 13. With segmentation, programs are divided into variable size segments, instead of fixed size pages.  Every logical address is formed of a segment name and an offset within that segment.  In practice, segments are numbered.  Programs are segmented automatically by compiler or assembler.
  • 14.  For logical to physical address mapping, a segment table is used.  When a logical address <s, d> is generated by processor: 1) Base and limit values corresponding to segment s are determined using the segment table. 2) The OS checks whether d is in the limit. ( 0=<limit) 3) If so, then the physical address is calculated as ( based + d), and the memory is accessed.
  • 15. Dynamic address translation. To dynamically translate a segment address to an absolute address: 1) Break the address into segment and displacement portions 2) Use the segment number to find the segment’s absolute entry point address in a program segment table 3) Add the displacement to the entry point address.
  • 16.  A program’s segments can vary in length.  Under paging, a program is broken into fixed-length pages. Page size is generally small (perhaps 2K to 4K), and chosen with hardware efficiency in mind.  Like segments, a program’s pages are loaded into noncontiguous memory.  Addresses consist of two parts , a page number in the high-order positions and a displacement in the low-order bits.  Addresses are dynamically translated as the program runs. When an instruction is fetched, its base-plus displacement addresses are expanded to absolute addresses by hardware.  Then the page’s base address is looked up in a program page table (like the segment table, maintained by the operating system) and added to the displacement.
  • 17. Advantages: 1) Address translation: each task has the same virtual address 2) Address translation: turns fragmented physical addresses into contiguous virtual addresses 3) Memory protection (buggy or malicious tasks can't harm each other or the kernel) 4) Demand loading (prevents big load on CPU when a task first starts running, conserves memory) 5) Memory mapped files 6) Virtual memory swapping (lets system degrade gracefully when memory required exceeds RAM size)
  • 18. 1) With segmentation and paging, addresses are divided into a segment number, a page number within that segment, and a displacement within that page. 2) After the instruction control unit expands the relative address, dynamic address translation begins. 3) First, the program’s segment table is searched for the segment number, which yields the address of the segment’s page table. 4) The page table is then searched for the page’s base address, which is added to the displacement to get an absolute address.
  • 19.
  • 20. The word virtual means “not in actual fact.”  To the programmer or user, virtual memory acts just like real memory, but it isn’t real memory.  Virtual memory is a model that holds space for the operating system and several application programs.  The operating system and selected pages occupy real memory.  Application programs are stored on an external paging device.
  • 21.
  • 22. Virtual memory is a model that simplifies address translation. It “contains” the operating system and all the application programs, but it does not physically exist anywhere.  Its contents are physically stored in real memory and on the external paging device.  Divided into two components. 1) First components - The first is exactly equal to the amount of real memory on the system and is physically stored in real memory. - It contains the resident operating system and the transient program area (called the page pool).
  • 23. 2) Second components - The second component of virtual memory consists of space over and above real memory capacity. - It is physically stored on the external paging device and contains the application programs. - The operating system is loaded into real memory. - Application programs are loaded onto the external paging device. - Selected pages are then swapped between the real memory page pool and the external paging device