Memory Management Virtual Memory Multi-asking

Shruti Shrivastava
4 min readFeb 27, 2020

Are you thinking that is a lot of big technical gibber-jabber that I don’t think I’ll be able to understand? Well think again and try exploring this topic which you actually use on an everyday basis. So, if you already use it without even knowing about it how easy the concept must really be (hint: very easy!).
Now what is memory management virtual memory multitasking? Let’s break the terms down for better understanding.
What do you understand by memory management? We all understand management refers to a systematic arrangement of specific objects for better documentation and easier access, similar is the case with memory management, only difference is instead of objects its data that has to allocated in the memory. Different memory management techniques include:
1) Single contiguous allocation: It is the simplest technique of memory management available. All the computer’s memory, with the exception of a small portion reserved for the operating system, is available to the single application. MS-DOS is an example of a system which allocates memory in this way. An embedded system running a single application might also use this technique.
A system using single contiguous allocation may still multitask by swapping the contents of memory to switch among users.
2) Partitioned allocation: The name suggests it all. In this type of memory management technique, the primary memory of the system is divided in fragments or partitioned into multiple memory portions, these portions are usually contiguous. Each portion might contain all the information for a specific task. It allocates a portion to a task when the task begins and un-allocating it when the task ends. This type of memory management can be both static, that is defined at Initial Program Load (IPL) or dynamic, automatically created for a specific job. Multiprogramming with a Fixed Number of Tasks (MFT) is an example of static partitioning, and Multiprogramming with a Variable Number of Tasks (MVT) is an example of dynamic.
3) Paged memory management: Paged allocation divides the computer’s primary memory into fixed-size units called page frames and the program’s virtual address space into pages of the same size. The hardware memory management unit maps pages to frames. The physical memory can be allocated on a page basis while the address space appears contiguous.
In paged memory management, each job runs in its own address space. Paged memory can be demand-paged when the system can move pages as required between primary and secondary memory.
4) Segmented memory management: Segmented memory management technique is unique and distinctive from other memory management techniques as it does not provide the user’s program with linear and contiguous address space. Segments are areas of memory that usually correspond to a logical grouping of information such as a code procedure or a data array. Segments require hardware support in the form of a segment table which usually contains the physical address of the segment in memory, its size, and other data.
Segmentation allows better access protection than other schemes because memory references are relative to a specific segment and the hardware will not permit the application to reference memory not defined for that segment. It is possible to implement segmentation with or without paging. Without paging support the segment is the physical unit swapped in and out of memory if required. With paging support the pages are usually the unit of swapping and segmentation only adds an additional level of security. Addresses in a segmented system usually consist of the segment id and an offset relative to the segment base address, defined to be offset zero.

Now for the second part of our high technical word, virtual memory. As we all understand from the word virtual, that is imaginary or not real similarly virtual memory is an imaginary memory location in an operating system. It acts as an alternate set of memory addresses and expands the range of available memory. In this way slow hard drive memory is used to supplement physical RAM. Programs use these virtual addresses for data that isn’t frequently addressed. When these virtual memory address locations are called, virtual memory is converted into RAM.

In order to copy virtual memory into RAM, the operating system divides virtual memory into pages. Each page contains a fixed number of addresses that are stored on disk until called by the operating system. When pages are called by the operating system they are copied from disk memory to RAM, a process which translates virtual addresses into real addresses. This process is known as mapping. The process of copying virtual pages from disk to main memory is known as paging or swapping.

Now you may ask what is multitasking. Well multitasking is a feature which enables an operating system to operate on two or programs at the same time in the same memory. This is an essential feature since it facilitates the user and increases the productivity.
Most operating systems perform similar functions that include managing programs, managing memory, scheduling jobs, configuring devices, accessing the Web, monitoring performance, providing housekeeping services, and administering security management.

--

--