Scheduling and Memory Management
Scheduling and Memory Management
memory management
BY:-
V.SRINADH
P.SANDEEP
Introduction to Memory
Management
• Definition: Memory management is the process of managing computer
memory, including allocation, deallocation, and protection.
• Why it's Important:
• Efficient memory usage improves system performance.
• Prevents crashes and memory leaks.
Types of Memory:-
• Physical Memory (RAM): Temporary storage for active data and
instructions.
• Virtual Memory: Allows programs to use more memory than
physically available by swapping data between RAM and disk.
• Primary vs. Secondary Memory:
• Primary: RAM (volatile)
• Secondary: Storage (non-volatile, e.g., HDD/SSD)
• Cache Memory: Fast memory used to store frequently accessed data.
Memory Allocation Techniques:-
• Contiguous Allocation: Memory is allocated in a single, continuous
block.
• Pro: Simple and efficient.
• Con: Leads to fragmentation.
• Non-contiguous Allocation: Memory is allocated in smaller, fixed-
sized blocks (paging/segmentation).
• Pro: No fragmentation.
• Con: More complex management.
Paging Concept:-
• What is Paging?: Divides memory into fixed-size pages.
• How It Works: Logical addresses are divided into page numbers and
offsets. The page number is mapped to a frame number in physical
memory using a page table.
• Page Fault: When a page is not in memory, it must be loaded from disk.
Fragmentation:-
• External Fragmentation: Free memory is scattered, making it difficult
to allocate large contiguous blocks.
• Internal Fragmentation: Wasted memory within allocated blocks
(common in paging).
• How Paging Reduces Fragmentation: Paging avoids external
fragmentation by using fixed-size blocks.
Segmentation:-