Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

IT2106

Memory Management o External fragmentation – This occurs when the allotted memory
Memory Management Requirements blocks are of varying sizes. This builds up due to the continuous
Memory management is the functionality of an operating system (OS) that removal of processes in the main memory.
manages the primary memory, which includes the movement of processes o Internal fragmentation – This occurs when the allotted memory
back and forth between the main and the secondary memory during blocks are of fixed size, and specific processes need more space or
execution. Memory management tracks every memory location, whether it is less space than the size of the allotted memory block (Parahar,
allocated or free, and checks the amount of memory to be allocated for each 2019)
process. It also facilitates the process allocation and correspondingly updates
the memory status (Tutorialspoint, n.d.). The following are the requirements that memory management intends to
satisfy (Stallings, 2018):
Types of addresses used in a program before and after memory allocation  Relocation: It is not possible for a programmer to know in advance
(Tutorialspoint, n.d.): which programs will reside in the main memory at the exact time of the
 Symbolic addresses – These are the addresses used in a source code. program execution. Hence, the possibility that the program may be
The variable names, constants, and instruction labels are the basic moved within the main memory due to swapping should always be
elements of a symbolic address space. considered. In addition, swapping active processes in and out of the
 Relative addresses – These are the addresses at the time of main memory to maximize processor utilization is also highly observed.
compilation. A compiler converts symbolic addresses into relative  Protection: Each process should be protected against unwanted
addresses. interference by other processes, whether accidental or intentional. Thus,
 Physical addresses – These addresses are generated by the loader programs in other processes should not be able to reference memory
when a program is loaded into the main memory. locations in a process, for reading or writing purposes, without
permission. A user process cannot access any portion of the operating
The following are the commonly used terms in memory management: system, neither program nor data. Usually, a program in one process
 Frame – This pertains to a fixed-length block of main memory. cannot branch to an instruction in another process, and without special
 Page – This refers to a fixed-length block of data that resides in the arrangement, a program in one process cannot access the data area of
secondary memory. A page of data may temporarily be copied into a another process.
frame in the main memory.  Sharing: Any protection mechanism must have the flexibility to allow
 Segment – A variable-length block of data that resides in the secondary several processes to access the same portion of the main memory. If a
memory. An entire segment may temporarily be copied into an available number of processes are executing the same program, it is
region of the main memory, or the segment may be divided into pages, advantageous to allow each process to access the same copy of the
which can be individually copied into the main memory (Stallings, 2018). program rather than have its own separate copy. In most cases,
 Swapping – It is a mechanism in which a process can be swapped processes that are cooperating on some task may need to share access
temporarily out of the main memory to the secondary memory in order to to the same data structure.
make memory space available for other processes. It is also known as  Logical organization: Most programs are organized into modules, some
memory compaction. of which are unmodified, read-only or execute-only, and some of which
 Fragmentation – This occurs due to the continuous loading and removal contain data that are modifiable. It would be a great advantage if the
of processes in the memory, wherein free memory spaces are broken operating system and computer hardware could effectively manage user
down into smaller fragments. This happens when processes cannot be programs and data in modules.
allocated to memory blocks because of their small size and memory  Physical organization: The task of moving and organizing information
blocks remains unused (Tutorialspoint, n.d.). flow between the main and the secondary memory should be a system
responsibility. This task is the essence of memory management.

05 Handout 1 *Property of
 STI
IT2106
Computer memory is organized into at least two (2) levels, which are as
follows:

05 Handout 1 *Property of
 STI
IT2106
o Main memory – This is a volatile memory that provides fast access Simple Segmentation. Each process is divided into a number of segments,
at a relatively high cost. The main memory technically holds wherein a process is loaded by adding all of its segments into dynamic
programs and data that are currently in use. partitions.
o Secondary memory – This is usually a non-volatile memory at a  There is no internal fragmentation in using this technique, resulting to an
cheaper cost with slower access. A secondary memory of large improved memory utilization and reduced overhead compared to
capacity is a good storage of programs and data for a longer term. dynamic partitioning.
 External fragmentation is a drawback of this technique.
Memory Partitioning Techniques
Fixed Partitioning. The main memory is divided into a number of static Virtual Memory
partitions at system generation time, wherein a process may be loaded into a Virtual memory is an abstraction of the main memory, providing processes
partition of equal or greater size. Nowadays, the use of fixed partitioning is and the kernel with their own, almost infinite, private view of the main
uncommon in the industry (Stallings, 2018). memory. Virtual memory is made possible through the support from both the
 It is simple to implement and produces only a minimal operating system processor and operating system. Below are some characteristics of a virtual
overhead. memory (Gregg, 2021):
 There is a high chance of inefficient use of memory due to internal  It supports multitasking, allowing processes and the kernel to operate on
fragmentation. their own private address space without worrying about contention.
 The maximum number of active processes that can be catered is fixed.  It supports oversubscription of the main memory, allowing the operating
system to transparently map virtual memory between the main and the
Dynamic Partitioning. The partitions are created dynamically, wherein each secondary memory, as needed.
process is loaded into a partition of exactly the same size as the process.  It is not a real memory and most operating systems map virtual memory
 This technique has no internal fragmentation, which results in a more to real memory only on demand (when the memory is first populated or
efficient use of the main memory. written).
 Inefficient use of the processor can transpire due to the need for memory
compression to counter external fragmentation. Virtual Memory Paging. This partitioning method is similar to simple paging,
Below are the three (3) possible placement algorithms that can be but does not necessarily load all of the pages of the process. This has no
considered in implementing dynamic partitioning: external fragmentation and encompass large virtual address space, that may
1. Best-fit – This chooses the block that is closest to the requested size. lead to a higher degree of multiprogramming.
2. First-fit – This scans the memory from the beginning and chooses
the first available block that is large enough to cater to the process. Virtual Memory Segmentation. This partitioning method is similar to simple
3. Next-fit – This scans the memory from the location of the last segmentation, but does not necessarily load all the segments of a process.
placement and chooses the next available block that is large enough This has no internal fragmentation and encompass a large virtual address
to cater to the process. space, that may also lead to a higher degree of multiprogramming.
Simple Paging. The memory is divided into a number of equally sized References:
Gregg, B. (2021). System performance: Enterprise and Cloud (2nd ed.). Pearson Education, Inc.
frames, while each process is divided into a number of equally sized pages Silberschatz, A., Galvin, P. & Gagne, G. (2018). Operating systems concepts (10th ed.). John Wiley & Sons, Inc.
of the same length as the frames. Then, a process is loaded by adding all of Stallings, W. (2018). Operating systems: Internal and design principles (9 th ed.). Pearson Education Limited
Tutorialspoint. (n.d.). Operating System – Memory Management. Retrieved on October 25, 2021 from
its pages into the available frames (Stallings, 2018). https://www.tutorialspoint.com/operating_system/os_memory_management.htm
 It plays an important role in implementing virtual memory. Parahar, M. (2019, November 28). Difference between internal fragmentation and external fragmentation. Retrieved on October 26, 2021
from https://www.tutorialspoint.com/difference-between-internal-fragmentation-and-external-fragmentation
 This technique reduces external fragmentation.
 This technique may cause a small amount of internal fragmentation.

05 Handout 1 *Property of
 STI

You might also like