Showing posts with label operating system memory management. Show all posts
Showing posts with label operating system memory management. Show all posts

Tuesday, 7 June 2011

OPERATING SYSTEM MEMORY MANAGEMENT

The operating system consists of many management units and memory management unit is one of them that provide the management functions for the memory such that full utilization of memory takes place. The multi-tasking of the users takes place because shared memory space is provided to various processes which are provided by memory management unit. Therefore, in this article I will explain to you the over-all role of the memory management in computer performance?


 
Management Unit in operating system? Role of the Memory management unit in Operating systemMemory management is the process of managing the computer memory which consist of primary memory or secondary memory. In this, we allocate the memory portions to programs and softwares after freeing the space of the computer memory. Basically, memory management is of critical importance for operating system because the multi-tasking can take place in the system which switches the memory space from one process to another. Moreover, the concept of the virtual memory is used in the system according to which programs from main memory are loaded to the secondary memory when the space is not large enough to hold the programs.The Disk swapping is used in which virtual memory separates the memory addresses using the physical addresses. The management of the virtual memory is carried out in computer system which will enhance the performance of the system by collecting the garbage database which is meant for allocation and deallocation of resources. As this garbage collection table is implemented in the programming structures that uses the region based management for the objects.
 

What is the role of the operating system in memory management unit?The concept of virtual memory is derived from this memory management unit because it provides the loader tool which loads the data from the secondary memory in main memory when required. There are so many benefits provided by this memory management system like multi-tasking of the programs in memory and many more. Many of the features of memory management unit are given below that describes the role of it in operating system.Every program for its execution requires some space in computer memory which is provided by memory management unit using virtual memory that provides the external storage addressing location for the Programs that does not have too much space in main memory for their execution and saved them in secondary memory but when required loaded them again in main memory. This deallocation and reallocation of programs in main memory deals with concurrency. At last, we say that loading capabilities of programs with the memory addressing is there in it.The data which we are using in our computer is kept in the secondary storage medium that stores the data permanently in computer memory because it is non volatile in nature and protection of the stored data in memory is provided by the memory management unit such that it will automatically repair and fix the errors there in the bad tracks and sectors. Moreover, as far as the data security is concerned then certain programs are protected with the master password that cannot allow the access of the data without the administrator confirmation. Moreover, certain programs are provided with the shell that protects them from malicious matter.
The data is organized in the well defined manner that provides the easier access of data to the user because sharing is used in which various processes shares the memory with each other using the inter process communication that allows the inter communication between the shared processes and the data stored in memory uses the logical and physical organization in which data are divided into modules that leads to internal and external fragmentation of the main memory such that main memory frames are divided into modules for the programs allocation that is known segmentation.

OPERATING SYSTEM MEMORY MANAGEMENT

Memory Management is a term used to describe how the operating system handles the available RAM. It is managed at multiple levels.Physical memory
 
At the most basic level, there is the physical memory. The physical memory's size is the sum of the capacities of all RAM-modules (such as DDR SDRAM) installed in the system. For example, when you have two 512 MiB DDR SDRAM modules installed in your system, the OS will have 1 GiB of physical memory at its disposal.Segmented memoryOn top of the physical memory is the segmented memory. It uses the Memory Management Unit (MMU) to translate a logical address (specifying a segment and an offset) into a physical address (or linear address).
This allowed early computers to address more than 64 KiB of memory. Most operating systems today don't use a segmented memory model, with the advent of paging. Paged memoryA paged memory model uses the MMU to translate virtual addresses to physical addresses. With paging, one can map multiple 4 KiB-sized chunks (called pages) to any virtual address. For example, data at offset 0x1000 in physical memory might be mapped to address 0xC0000000 (at offset 3 GiB) in virtual memory, even though the system may have only 32 MiB of physical RAM available. Accessing the data at address 0xC0000000 internally accesses the data at physical address 0x1000. This provides processes with their own virtual address space which contains only the code and data required by that single process, and everything else is hidden. This way, a process can't corrupt another process' code or data, improving security and reliability.Allocated memoryWith paging, memory is managed in 4 KiB-sized chunks. Most applications require the ability to be able to get only a fraction of that size, to store data. The memory allocator gets a big chunk of memory (say, 4 pages, or 4 * 4 KiB) and divides this into much smaller chunks (e.g. a chunk of 16 bytes and another chunk of 6 bytes.) which it gives to the applications when requested. The Heap


 
 Many Languages and some operating systems use a form of allocated memory called a HEAP, essentially one large space where memory can be used and re-used. Associated with the heap, is the need to do a process called garbage collection, where now allocated space is consolidated to form larger spaces, and the heap recovers from the eventual fragmentation that happens when the sizes of records using the same space at different times are not congruent and are guarded by other allocated spaces that remain active. The fragmentation effect results in lots of small unusable spaces spread throughout the heap. Garbage collection may for instance involve the movement of an allocated memory from one location to another in order to free up more space. To achieve this transparently to the memory, the allocation unit address must not be the same as the public address, but the public address must be a reference to a look-up table that contains the allocation unit address.
The garbage collector can then write a copy of the data to a new address, and then change the look-up table address before removing the original data and allowing the consolidation process to recover the space. Another technique is to reference the start and end point of each allocated memory unit, and when a memory unit is released, test to see if the unit before and after it are either free, and if so reallocate a larger block that contains all the free sections that are contiguous. During allocation the allocation utility will start at the top of the list of free sections and look to see if any are exactly the size requested, if so, the first that fits will be selected, then the next largest one if none are found the exact size. Garbage collection can be done continuously or at low use times, with the eventual caveat that if no low use times are found, the garbage collection will cause the whole computer to slow down temporarily when fragmentation becomes unwieldy.

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Online Project management