The computer hardware that is responsible for managing the computer’s memory system is called the memory management unit (MMU). This component serves as a buffer between the CPU and system memory. The functions performed by the memory management unit can typically be divided into three areas: hardware memory management, operating system memory management and application memory management. Although the memory management unit can be a separate chip component, it is usually integrated into the central processing unit (CPU).
Generally, the hardware associated with memory management includes random access memory (RAM) and memory caches. RAM is the physical storage compartment that is located on the hard disk. It is the main storage area of the computer where data is read and written. Memory caches are used to hold copies of certain data from the main memory. The CPU accesses this information held in the memory cache, which helps speed up the processing time.
When the physical memory, or RAM, runs out of memory space, the computer automatically uses virtual memory from the hard disk to run the requested program. The memory management unit allocates memory from the operating system to various applications. The virtual address area, which is located within the central processing unit, is comprised of a range of addresses that are divided into pages. Pages are secondary storage blocks that are equal in size. The automated paging process allows the operating system to utilize storage space scattered on the hard disk.
Instead of the user receiving an error message that there is not enough memory, the MMU automatically instructs the system to build enough virtual memory to execute the application. Contiguous virtual memory space is created out of a pool of equal size blocks of virtual memory for running the application. This feature is a major key to making this process work effectively and efficiently because the system is not required to create one chunk of virtual memory to handle the program requirements. Creating various sizes of memory space to accommodate different size programs cause a problem known as fragmentation. This could lead to the possibility of not having enough free space for larger programs when the total space available is actually enough.
Application memory management entails the process of allocating the memory required to run a program from the available memory resources. In larger operating systems, many copies of the same application can be running. The memory management unit often assigns an application the memory address that best fits its need. It’s simpler to assign these programs the same addresses. Also, the memory management unit can distribute memory resources to programs on an as needed basis. When the operation is completed, the memory is recycled for use elsewhere.
One of the main challenges for memory management unit is to sense when data is no longer needed and can be discarded. This frees up memory for use on other processes. Automatic and manual memory management has become a separate field of study because of this issue. Inefficient memory management presents a major issue when it comes to optimal performance of computer systems.