Docsity

Operating System - Memory Management Part 2 - Notes, Study notes of Operating Systems

Partial preview of the text

Download Operating System - Memory Management Part 2 - Notes and more Study notes Operating Systems in PDF only on Docsity!

MEMORY MANAGEMENT

Fixed and Variable Partition

  • (^) Fixed Partition : Memory is divided into chunks. For example, 4K/8K/16K Bytes. All of these are same size.
  • (^) Allocation : If a certain chunk can hold the program/data, then the allocation. If a chunk can not hold program/data then multiple chunks are allocated to accommodate the program/data.

Fragmentation

  • (^) Fixed Size: Internal Fragmentation
  • (^) Variable Size: External Fragmentation

Types of Fragmentation

  • (^) External Fragmentation โ€“ total memory space exists to satisfy a request, but it is not in sequence.
  • (^) Internal Fragmentation โ€“ allocated memory may be slightly larger than requested memory; this size difference is memory internal to a partition, but not being used

Solution for Fragmentation

  • (^) Internal Fragmentation may be solved by using fixed size paging approach.

Solution for Fragmentation

  • (^) External Fragmentation may be solved by using variable size segmentation approach.

Paging

  • (^) Divide logical memory into blocks of same size called pages.
  • (^) Keep track of all free frames
  • (^) To run a program of size n pages, need to find n free frames and load program
  • (^) Set up a page table to translate logical to physical addresses
  • (^) Internal fragmentation

Paging Example

Free Frames

Before allocation (^) After allocation

Segmentation

  • (^) Memory-management scheme that supports user view of memory
  • (^) A program is a collection of segments. A segment is a logical unit such as: main program, procedure, function, method, object, local variables, global variables, common block, stack, symbol table, arrays

Logical View of Segmentation

1 3 2 4 1 4 2 3 user space physical memory space

Segmentation Architecture

(Cont.)

  • (^) Relocation.
    • (^) dynamic
    • (^) by segment table
  • (^) Sharing.
    • (^) shared segments
    • (^) same segment number
  • (^) Allocation.
    • (^) first fit/best fit
    • (^) external fragmentation