Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Requirements of memory management system
Memory is considered a major part of the operating system to store and access data. Memory management is a complex task performed by the OS when the main memory has limited space and requires more switching operations during multiuser environments. It manages the status of processes in ready, waiting, or execution states and allocates or frees memory locations based on the completion of each process. Each process is allocated to a specific memory location and its status is monitored and updated in the memory management system. During a multiprogramming environment, the operating system subdivides memory for multiple processes to perform their functions simultaneously, requiring proper memory management so that the processor never enters an idle state.
Memory management has two different schemes to store data in the system. The contiguous approach assigns processes to fixed blocks of memory with larger sizes stored in consecutive memory addresses, whereas the non-contiguous approach stores processes in different blocks located at different memory portions that need not be consecutive. The non-contiguous approach is more efficient as it uses memory spaces only when needed.
Requirements of Memory Management System
The memory management system requires several basic requirements for effective processing and storage, which are discussed below.
Memory Sharing
During a multi-process environment, all processes access the same part of the main memory. Protection measures are required during this sharing process, which is handled by memory management. This sharing approach is advantageous because each process does not need a separate copy to be created as they access the shared copy already available in memory. Shared memory is considered an efficient approach for inter-process communication methods.
Memory Protection
Protection mechanisms must be satisfied by the processor in the execution state to avoid interference from other unauthorized processes attempting to perform write operations to the same file located in shared memory space. This control is handled by the processor rather than the operating system, as the OS functions to control processes and check references to valid memory locations. In simple terms, protection is the method of securing memory from unauthorized processes.
Address Mapping and Relocation
During process execution, the user may not know about other programs residing in main memory. When swapping occurs to disk, processes return to main memory but at different locations. Relocation happens after swapping because the previous memory location will now be used by another process. Once a process loads into memory, translation must occur from logical address to physical address, performed by the associated process and operating system. A physical address contains a combination of logical addresses and contents from the relocation register.
Logical Addressing
Programs stored in memory units are organized into modules that are modifiable with read and execute permissions, though some modules lack modification permissions. Main memory is represented as a sequence of bytes or words in a linear, one-dimensional address space. Logical addresses are generated by the CPU during process runtime. User programs are divided into independently compiled modules whose references are addressed during system runtime. Protection can vary at each level of logical spaces where different modules reside.
Physical Space Management
System memory has two divisions: main memory and secondary memory. Main memory (volatile) stores and handles current executing programs with better performance, while secondary memory (non-volatile) supports long-term data storage but provides less performance compared to main memory. The information flow and swapping process can be complex for users to understand.
The overlaying approach can be used when main memory and data storage requirements are insufficient. This method allows various modules of a user program to be allocated to the same memory space. The major drawback during multiprogramming environments is that users do not know details about space and location in memory during program execution.
Key Benefits
| Requirement | Purpose | Benefit |
|---|---|---|
| Memory Sharing | Multiple processes access same memory | Efficient resource utilization |
| Memory Protection | Prevent unauthorized access | System security and stability |
| Address Mapping | Translate logical to physical addresses | Flexible memory allocation |
| Logical Addressing | Organize programs into modules | Better program structure |
| Physical Space | Manage memory hierarchy | Optimal performance balance |
Conclusion
The memory management system controls and manages available and free spaces during process execution and idle phases. It provides dynamic allocation based on user requests and deallocates unused memory when not needed. These requirements ensure effective storage and processing of user programs in modern operating systems.
