Operating System
OS Part-1
OS Part-2
- File Concepts and Access methods
- Free Space Management and Allocation methods
- Directory Systems and Protection
- File Organization, Sharing and Implementation issues
- Disk and Drum Scheduling
- I/O Devices Organisation & I/O Buffering
- I/O Hardware, Kernel I/O subsystem and Transforming I/O Requests to Hardware Operations
- Device Drivers and Path Management
- Device Driver Sub Modules and Procedure
- Device Scheduler and Handler
- Interrupt Service Routine (ISR)
- File System in Linux and Windows
OS Part-3
- Process and Process Control Block(PCB)
- Process Scheduling( Preemptive and Non Preemptive)
- Scheduling Algorithms
- Algorithm Evaluation
- Multiple Processor Scheduling
- Real Time Scheduling
- Operations on Processes
- Threads
- Inter-Process Communication
- Precedence Graphs
- Critical Section Problem
- Semaphores
- Classical Problems of Synchronization
- DeadLock
- Deadlock Prevention and Avoidance
- Deadlock Detection and Recovery
- Process Management in Linux
OS Part-4
- Memory Hierarchy in OS
- Concepts of Memory Management
- MFT and MVT
- Logical and Physical Address Space
- Swapping
- Contiguous and Non Contiguous Memory Allocation
- Paging
- Segmentation
- Paging Combined with Segmentation
- Structure and Implementation of Page Table
- Virtual Memory in OS
- Cache Memory Organization
- Demand Paging
- Page Replacement Algorithms
- Allocation of Frames and Thrashing
- Demand Segmentation
OS Part-5
- Distributed Operating System: Introduction and Types
- Distributed OS: Design Issues
- Distributed OS: File System
- Distributed OS: Remote File Access
- Remote Procedure Call(RPC)
- Remote Method Invocation(RMI)
- Distributed Shared Memory
- Parallel Processing and Concurrent Programming
- Security and Threats Protection in Distributed OS
- Security Design Principles and Authentication in Distributed OS
- Sensor Network and Parallel OS
Concepts of Memory Management in Operating System
Memory Management ek essential function hai jo OS aur applications ke beech memory ko allocate aur deallocate karta hai. Iska main goal efficient memory utilization aur fast execution ensure karna hota hai.
🔹 What is Memory Management?
Memory Management ek process hai jo system ki memory ko manage karta hai, taki multiple processes efficiently execute ho sakein.
💡 Key Functions of Memory Management:
✔ Process ko memory allocate karna aur free karna
✔ Memory fragmentation ko minimize karna
✔ CPU aur disk ke beech smooth data transfer ensure karna
✔ Virtual memory aur paging jaisi techniques ka use karna
🔹 Types of Memory in Memory Management
OS do types ki memory handle karta hai:
1️⃣ Primary Memory (Main Memory)
RAM (Random Access Memory) jo CPU directly access karta hai.
Volatile Memory hoti hai, yani power off hone par data erase ho jata hai.
Fast but limited storage capacity hoti hai.
✔ Example: Jab aap ek game open karte ho, toh uska data temporarily RAM me store hota hai execution ke liye.
2️⃣ Secondary Memory
Permanent storage ke liye HDD/SSD use hoti hai.
OS aur applications ka data yahan store hota hai.
Slow but large storage hoti hai.
✔ Example: Windows ka C:\ drive ek secondary storage hai jisme OS install hota hai.
🔹 Memory Management Techniques
1️⃣ Contiguous Memory Allocation
Ek process ko ek continuous block of memory allocate hota hai.
Memory fragmentation ka issue ho sakta hai.
💡 Example:
Agar RAM 100 MB hai aur process ko 30 MB chahiye, toh ek continuous 30 MB block allocate hoga. Agar chhoti-chhoti fragments bach jayein, toh kuch processes allocate nahi ho sakti.
✔ Solution: Compaction technique use karke free memory ko ek sath arrange kiya jata hai.
2️⃣ Paging (Non-Contiguous Memory Allocation)
Memory ko fixed-size blocks (pages) me divide kiya jata hai.
Har process ko pages assign kiye jate hain jo RAM me kisi bhi location par store ho sakte hain.
💡 Example:
Agar RAM me scattered free spaces hain, toh process ke different pages alag-alag locations par store ho sakte hain, jisse memory fragmentation problem solve hoti hai.
3️⃣ Segmentation
Memory ko variable-size segments me divide kiya jata hai.
Logical divisions jese Code, Data, Stack alag-alag segments me store hote hain.
✔ Example:
Ek C program ka Code Segment, Data Segment aur Stack Segment alag-alag memory me store hota hai.
4️⃣ Virtual Memory
Agar RAM full ho jaye, toh secondary storage ka ek part (swap space) use hota hai.
Paging aur demand paging ka use hota hai.
💡 Example:
Agar aapke system ki RAM 4GB hai aur aap 8GB ka software run karte hain, toh extra 4GB ka data HDD ke ek part (Page File) me store hoga.
🔹 Memory Allocation Strategies
✅ First Fit: Pehla available block allocate hota hai.
✅ Best Fit: Sabse chhota possible block allocate hota hai.
✅ Worst Fit: Sabse bada block allocate hota hai.
✔ Example:
Agar RAM me 100MB, 50MB aur 20MB ke free blocks hain aur ek process ko 18MB chahiye, toh:
First Fit: 20MB block milega.
Best Fit: 20MB block milega.
Worst Fit: 100MB block milega.
🔹 Conclusion
✔ Memory Management OS ka critical function hai jo efficiency badhata hai.
✔ Paging, Segmentation aur Virtual Memory techniques system performance ko optimize karti hain.
✔ Best memory allocation technique choose karna system ki speed aur performance improve karta hai.