This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.
Program execution is the main propose of computer system .During execution programs are together with the data they access with in main memory. To keep track of what memory is in use and what memory is free is called memory management. Allocate the free memory to the process when any process needed the free space and de-allocates it when they don't need the free space.
Ideally, programmers want memory that is
There are two classes of memory management systems, those that transfer processes to and from disk during execution are the swapping or paging .And those that don't are the simple and might find this scheme in embedded device, phone, smart card, or PDA.
Basic Memory Management without Swapping or Paging
There are three simple ways of organizing memory, operating system with one user process.
How to divide memory
Two approaches are one divide the memory into fix equal partitions and the other is partition size can be loaded into any other partition.
Any unused space in the partition is wasted called internal fragmentation. And process which is larger than partition cannot be run.
Fixed size partitions
In fixed partition processes are in queues that are fits in it, but some partitions may be idle because jobs are available in small partitions and only the large partition free.
Memory management in Operating systems
Linux Memory Management:
There are two main component of Linux memory management.
The first one component is to assign and freeing the space, after using the physical memory.
The second component deals with virtual memory.
Physical memory management
Linux divide its physical memory into three different parts because it has different hardware characteristics. These three parts are the following:
Page allocator is the primary physical memory manger in Linux. For every zone separate allocator is exist which allocate and freeing the space for the zone. The allocator uses the Buddy system to keep all records about physical pages which is available at the time in memory.
Memory splitting into Buddy system
Virtual memory management
There are many types of virtual memory regions in Linux. Backing store for the region is the first property of this memory. Which describe the pages region that from where it is to come. Mostly region is back by nothing which represents the demand-zero memory.
Windows Memory Management:
The window provide many ways to the application for using memory like virtual memory, heaps, memory mapped files and thread local storage.
VirtualAlloc() is the method which is used to allocate the virtual memory and virtualFree() method is use to de-allocate the space into virtual memory. The virtual address in which the memory is allocated through these functions applications are enable.
They operate on multiple pages which are in memory and the starting address must be greater than 0*10000.
Applications used the memory space also through heap. In this environment address space is already reserve. When API process is start (also called initialized) it creates the 1-MB default heap.
Memory mapping Files
The third way of using the memory space is the memory mapping files. Through this way two processes can share the memory space .In virtual memory two files share the same file.
Thread Local storage
Thread local storage is another way for applications to using memory space. For using memory space this provide two methods. This is given below:
Memory management in windows and Linux
A process is an EXE file in windows when a program is running it is a process. In windows there is several processes can also work at a time but by implementing memory management system. Process manager share its memory resources to each process that's way multiple processes can also be start at a time in windows.
2.Segments registers in WIN32:
Segments registers are implemented in win32 while debugging.
in 32 bit mode segment registers are also implemented in Intel microprocessors. Virtual memory base address and blocks are described in descriptive table. These segments can be read only and sometime read/write. Segments can be in 4GB. There are two segments
In case if you think you have less memory for your memory management
Windows provide memory management mapped files.
Physical memory is most important resource of a computer system. Windows memory manger is responsible to populate memory of system
Shared among processes if desired.
1.Virtual memory management system
Linux use virtual memory management system. The bit of the processor that perform this transaction is the memory management unit
2.Large Address Spaces
Physical memory is always less then virtual memory always in the system; The operating system makes the system appear if it has a large memory than it actually has.
in system every process has its own virtual address space. The processes that are running at a time cannot effect to virtual address Also allow memory against writing is always protected by , the hardware virtual memory mechanisms This protects code and data from being overwritten by rogue applications.
4.Fair Physical Memory Allocation
Exact and fare share policy of the physical memory in the system is done by memory subsystem management
5.Shared Virtual Memory
Separate address space is allow to each process by the shared virtual memory. if there are several processes are running at a time in a system then it will fairly allocate virtual memory to them
Image and data files are mapped by the memory mapping in the system address space. every process create link to the virtual address space for a process