Operating System: COSC1112/1114 Memory Management Concepts

Verified

Added on  2022/09/18

|10
|1528
|38
Report
AI Summary
This report delves into the fundamental concepts of operating system memory management. It begins by defining the role of an operating system in managing primary memory, including process movement and swapping. The report then explores system calls, explaining their function as programmatic interfaces for interaction between programs and the OS kernel, covering examples from UNIX and Windows. The discussion proceeds to memory fragmentation, differentiating between external and internal fragmentation and introducing compaction as a solution. Paging and segmentation, two key memory management techniques, are then examined, with paging addressing external fragmentation and segmentation dividing tasks into variable-length segments. The report concludes with an overview of page replacement algorithms, crucial for handling page faults and optimizing memory allocation. The report also touches on concepts of memory allocation and system calls.
tabler-icon-diamond-filled.svg

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Running head: OPERATING SYSTEM
Operating System
Name of the Student:
Name of the University:
Author note:
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
1
Table of Contents
Memory management.................................................................................................................3
The System Calls........................................................................................................................3
Fragmentation............................................................................................................................5
Paging.....................................................................................................................................6
Segmentation..........................................................................................................................7
Page Replacement Algorithm....................................................................................................8
References..................................................................................................................................9
Document Page
2
Memory management
An operating system is a general purpose software provides an environment for the
users to run various applications in a computing system. Operating system has the
functionality of memory management for the computing devices to handle primary memory
management, moves process, swapping of processes between disk and main memory during
program execution. This is the primary function of an operating system to monitor every
individual memory location in the devices whether it is allocated by any of the resources of
the system or it is free. The process of memory allocation can be done through the use of
memory management strategy (Comer, 2015). It keeps tracks the amount of memory
allocated by a process, also manages the amount of time needed by the process to execute the
task. Thus whenever the memory gets unallocated or freed from resources the corresponding
status is update by it.
The System Calls
In a computing system, the term system call describe a way in which the system generate
a service request to the kernel of the OS in which the system is executed. It describes the
programmatic interface for the programs so that they can be able to interact with the
computer operating system (Takahashi, 2015). The operating system services can be done
through the system which require an Application Program Interface (API). It gives an
interface to the operating system and the processes which permit users level processes that
gives the service request to the OS. Only through the use of system call one can enter into the
kernel of the system. All the program resources must be use the system call to access into the
kernel. These are the services provided by the system calls:
Document Page
3
i. Process creation and process management
ii. Primary memory management
iii. File system and directory management, File access
iv. Handling devices (I/O)
v. Protection
vi. Networking, etc.
There are various types of system call includes – Controlling processes, file management,
device management, maintenance of information and communication. These are the examples
of UNIX and WINDOWS system calls-
System Calls Unix Windows
Process Control
fork()
wait()
exit()
CreateProcess()
WaitForSingleObject()
ExitProcess()
File Manipulation
write()
close()
open()
read()
WriteFile()
CloseHandle()
CreateFile()
ReadFile()
Information Maintenance
getpid()
sleep()
pipe()
alarm()
GetCurrentProcessID()
Sleep()
CreatePipe()
SetTimer()
Communication shmget()
mmap()
CreateFileMapping()
MapViewOfFile()
Protection
umask()
chown()
chmod()
InitlializeSecurityDescriptor()
SetSecurityDescriptorGroup()
SetFileSecurity()
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
4
Fragmentation
The processes can be loaded in the memory, similarly processes can also remove for
the main memory of the system. Therefore the memory that is allocated by the resources
recently freed are broken down into various smaller chunks. Sometimes it may happens that
some processes are not be able to allocate to the block of memory. Therefore, the small
chunks of memory block remain unused by the processes. This of problem can cause the
wastage of memory (Hornung, Perazzi & Wang, 2018). This is the problem in the memory
management techniques called as fragmentation. Memory fragmentation can be divided into
two types- External memory fragmentation and internal memory fragmentation. In case of
external fragmentation, the total amount of memory space reside inside a process must be
enough to request a system call, but it should not be contiguous. On the other hand, in
internal fragmentation, a bigger amount of block of memory is assigned to the processes
(Kim & et al., 2016). Therefore, there may happens a situation where some of the portion of
the memory left unused by the processes and another processes cannot be able to use this
memory chunks. Since fragmentation can lead to the wastage of memory, hence there is a
technique called compaction which is used to create a free memory by integrating the smaller
fragmented memory chunks.
Fragmented memory
Document Page
5
Memory after compaction
The compaction technique of memory management can be used to shuffle all the
smaller memory chunks to place each of the free memory, together into a large block.
Therefore the compaction mechanism makes it feasible and dynamic for the reallocation of
the processes in the memory (Silberschatz, Gagne & Galvin, 2018). In contrast, to reduce the
internal fragmentation, it should need to allocate the smallest partition in a block in an
effective way so that the size of the memory should be large enough to allocate the process.
Paging
To overcome the problem external fragmentation, the concept of paging can be used.
Paging is a simple technique and can be consider as an effective memory management
mechanism. A computer system can address the virtual memory. The paging mechanism
plays a vital role in the implementation of virtual memory. It is a memory management
methodology which access the address space broken into smaller size of blocks known as
pages. The size of each processes are measured by the page numbers (Oukid et al., 2017).
Similarly, the main memory is also divided into smaller blocks, which is fixed in size called
frames. The size of the frame should be minimum to the deployment of the main memory so
that it could avoid the external fragmentation.
Document Page
6
Paging technique
Segmentation
It is another memory management mechanism in which the overall task is divided in
form of smaller segments and the size of each segments are different. The individual segment
describes the logical-address spaces in the program (Seshadri & et al., 2016). Whenever a
process is going to be executed, the equivalent segmentations are also loaded into the
contiguous memory chunks. It works almost similar to paging technique but only difference
is that it contains variable length segments whereas in paging the size of the pages are fixed.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
7
Segmentation technique
Page Replacement Algorithm
The various types of page replacement algorithms(PRAs) are used by an OS to swap
out memory pages, writing into the disk whenever a pages needed to be allocated. The paging
technique is require when a page fault invoked in the system (Tarradell & et al., 2017). An
optimal page replacement algorithm reduces the page fault at the minimal level. The different
page replacement algorithms FIFO (First In First Out), LRU (Least Recently Used) etc., are
used to scheduled process in the memory. Therefore, it helps to manages processes with
highest priority called by the system and provides optimum results.
Document Page
8
References
Comer, D. (2015). Operating system design: the XINU approach. Chapman and Hall/CRC.
Hornung, A. S., Perazzi, F., & Wang, O. (2018). U.S. Patent No. 9,881,380. Washington,
DC: U.S. Patent and Trademark Office.
Kim, S. H., Kwon, S., Kim, J. S., & Jeong, J. (2016). Controlling physical memory
fragmentation in mobile systems. ACM SIGPLAN Notices, 50(11), 1-14.
Oukid, I., Booss, D., Lespinasse, A., Lehner, W., Willhalm, T., & Gomes, G. (2017).
Memory management techniques for large-scale persistent-main-memory systems.
Proceedings of the VLDB Endowment, 10(11), 1166-1177.
Seshadri, V., Pekhimenko, G., Ruwase, O., Mutlu, O., Gibbons, P. B., Kozuch, M. A., ... &
Chilimbi, T. (2016). Page overlays: An enhanced virtual memory framework to
enable fine-grained memory management. ACM SIGARCH Computer Architecture
News, 43(3), 79-91.
Silberschatz, A., Gagne, G., & Galvin, P. B. (2018). Operating system concepts. Wiley.
Takahashi, M. (2015). U.S. Patent No. 8,930,659. Washington, DC: U.S. Patent and
Trademark Office.
Document Page
9
Tarradell, M. M., Burbidge, R., Heo, Y. H., Sirotkin, A., Jain, P., & Phuyal, U. (2017). U.S.
Patent Application No. 15/126,560.
chevron_up_icon
1 out of 10
circle_padding
hide_on_mobile
zoom_out_icon
logo.png

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]