Execution of ProgramA process is basically a program in execution. The execution of a process must progress in a sequential fashion. Aprocess is defined as an entity which represents the basic unit of work to be implemented in the system. To put it insimple terms, we write our computer programs in a text file and when we execute this program, it becomes aprocess which performs all the tasks mentioned in the program. When a program is loaded into the memory and itbecomes a process, it can be divided into four sections ? stack, heap, text and data.2. Single contiguous modelThe main memory must accommodate both the operating system and the various user processes. Wetherefore need to allocate different parts of the main memory in the most efficient way possible. Thememory is usually divided into two partitions: one for the resident operating system, and one for the userprocesses. We may place the operating system in either low memory or high memory. With this approacheach process is contained in a single contiguous section of memory. One of the simplest methods formemory allocation is to divide memory into several fixed-sized partitions. Each partition may containexactly one process. In this multiple-partition method, when a partition is free, a process is selected fromthe input queue and is loaded into the free partition. When the process terminates, the partition becomesavailable for another process. The operating system keeps a table indicating which parts of memory areavailable and which are occupied. Finally, when a process arrives and needs memory, a memory sectionlarge enough for this process is provided.3. Partition ModelIn this type of allocation, main memory is divided into a number of fixed-sized partitions where eachpartition should contain only one process. When a partition is free, a process is selected from the inputqueue and is loaded into the free partition. When the process terminates, the partition becomes available foranother process.4. FragmentationAs processes are loaded and removed from memory, the free memory space is broken into littlepieces. It happens after sometimes that processes cannot be allocated to memory blocksconsidering their small size and memory blocks remains unused. This problem is known asFragmentation.Fragmentation is of two types –External fragmentationTotal memory space is enough to satisfy a request or to reside a process in it, but it is not contiguous, soit cannot be used.Internal fragmentationMemory block assigned to process is bigger. Some portion of memory is left unused, as it cannot be usedby another process.External fragmentation can be reduced by compaction or shuffle memory contents to place all freememory together in one large block. To make compaction feasible, relocation should be dynamic.The internal fragmentation can be reduced by effectively assigning the smallest partition but largeenough for the process.5. Introduction to virtual memoryA computer can address more memory than the amount physically installed on the system. Thisextra memory is actually called virtual memory and it is a section of a hard that's set up toemulate the computer's RAM. Paging technique plays an important role in implementing virtualmemory.Paging is a memory management technique in which process address space is broken into blocksof the same size called pages (size is power of 2, between 512 bytes and 8192 bytes). The size ofthe process is measured in the number of pages.Similarly, main memory is divided into small fixed-sized blocks of (physical) memorycalled frames and the size of a frame is kept the same as that of a page to have optimumutilization of the main memory and to avoid external fragmentation.6. Demand PagingDemand paging is a type of swapping done in virtual memory systems. In demand paging, thedata is not copied from the disk to the RAM until they are needed or being demanded by someprogram. The data will not be copied when the data is already available on the memory. This isotherwise called a lazy evaluation because only the demanded pages of memory are swappedfrom the secondary storage (disk space) to the main memory. In contrast during pure swapping allthe memory for a process is swapped from secondary storage to main memory during the processstartup.7. MMU MappingMMU (Memory Management Unit):-It is computer hardware that maps logical address to physical address. The run time mappingbetween Virtual address and Physical Address is done by hardware device known as MMU. Itconverts virtual address in pages and assign page offset to them that help them in mapping tomain memoryWorks:-1) It regulates RAM and caching memory2) It work is to regulate availability of memory resources.(managing memory resources)3) Work is to allocate memory to every process and free when they have used it.8. SegmentationSegmentation is a memory management technique in which each job is divided into several segments ofdifferent sizes, one for each module that contains pieces that perform related functions. Each segment isactually a different logical address space of the program.When a process is to be executed, its corresponding segmentation are loaded into non-contiguousmemory though every segment is loaded into a contiguous block of available memory.Segmentation memory management works very similar to paging but here segments are of variable-length where as in paging pages are of fixed size.A program segment contains the program's main function, utility functions, data structures, and so on.The operating system maintains a segment map table for every process and a list of free memory blocksalong with segment numbers, their size and corresponding memory locations in main memory. For eachsegment, the table stores the starting address of the segment and the length of the segment. A referenceto a memory location includes a value that identifies a segment and an offset.