KEMBAR78
Unit III Memory Management Notes | PDF | Computer Data Storage | Computer Science
0% found this document useful (0 votes)
10 views3 pages

Unit III Memory Management Notes

Memory management is a technique for managing RAM in an operating system, focusing on allocating memory for processes and improving system performance while reducing fragmentation. Key concepts include swapping, contiguous and non-contiguous memory allocation methods like paging and segmentation, and virtual memory, which extends RAM using disk space. Fragmentation issues and thrashing can arise, necessitating effective management strategies to optimize performance.

Uploaded by

Prajwal Tilekar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

Unit III Memory Management Notes

Memory management is a technique for managing RAM in an operating system, focusing on allocating memory for processes and improving system performance while reducing fragmentation. Key concepts include swapping, contiguous and non-contiguous memory allocation methods like paging and segmentation, and virtual memory, which extends RAM using disk space. Fragmentation issues and thrashing can arise, necessitating effective management strategies to optimize performance.

Uploaded by

Prajwal Tilekar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Unit III: Memory Management – Notes

1. What is Memory Management?


 A technique for managing RAM in an OS.
 Helps in:
 - Allocating/deallocating memory for processes.
 - Tracking used and free memory.
 - Improving concurrency and system performance.
 - Reducing fragmentation and ensuring data integrity.

2. Swapping
 Moves inactive processes from main memory to secondary storage (and back).
 Backing Store: Fast disk to hold memory images.
 Roll In/Roll Out: Used for priority-based scheduling.
 Pros: Better utilization, flexibility, and performance.
 Cons: Overhead, disk I/O, possible data issues.

3. Contiguous Memory Allocation


 Divides memory into fixed or variable-size blocks.
 Fixed-size partitioning: Static, causes internal fragmentation.
 Variable-size partitioning: Dynamic, reduces internal fragmentation.
 Uses relocation registers (base & limit) to protect memory.
 Pros: Easy access, high performance.
 Cons: Fragmentation, growing files are harder to manage.

4. Partition Allocation Methods


 First Fit: First block large enough is chosen.
 Best Fit: Smallest suitable block.
 Worst Fit: Largest available block.
 Next Fit: Similar to First Fit but starts from last allocated block.

5. Paging
 Non-contiguous memory allocation.
 Pages: Logical memory blocks.
 Frames: Physical memory blocks.
 Uses a page table for address translation.
 Causes internal fragmentation.
6. Segmentation
 Divides memory into logical segments (functions, arrays, etc.).
 Each segment has:
 - Base address
 - Limit (length)
 Provides better memory protection and isolation.

7. Paging vs. Segmentation


 Paging: Fixed-size blocks, internal fragmentation, limited protection.
 Segmentation: Variable-size logical units, external fragmentation, better protection.

8. Virtual Memory
 Uses hard disk as extension of RAM.
 Enables running large or many apps simultaneously.
 Advantages:
 - Increased address space.
 - Efficient memory use.
 - Automatic data movement.
 Disadvantages:
 - Overhead (page faults, slowdowns).
 - Complex implementation.

9. Page Replacement Algorithms


 Used when a page must be swapped in, but no free frame exists.
 FIFO: Replaces the oldest page, suffers from Belady’s Anomaly.
 LRU: Replaces the least recently used page, efficient but needs hardware support.
 Optimal (OPT): Replaces page not used for longest future time, ideal but impractical.

10. Frame Allocation Techniques


 Equal: All processes get equal frames.
 Proportional: Based on process size.
 Priority: Higher priority = more frames.
 Global Replacement: Any process can take frames.
 Local Replacement: Each process uses only its own frames.

11. Fragmentation
 Internal Fragmentation: Wasted space within allocated memory.
 External Fragmentation: Wasted space between allocated memory blocks.
 Solved by compaction (external) and best-fit allocation (internal).

12. Thrashing
 Too many page faults lead to low CPU performance.
 Caused by excessive paging and low available frames.
 Solutions:
 - Reduce degree of multiprogramming.
 - Use better page replacement policies.
 - Monitor and control memory usage.

You might also like