Course: Operating systemsTitle: Memory and Memory ManagementAuthor: Abigail SyanwaAdmission Number: 99270Lecturer: Mr. Philip Neri AbstractMemory management is a very important function in operating systems because any program execution requires us to put the program in the memory. (Hayes, 1998)Memory is a very important but finite resource; therefore, the aim is to optimize its use.This means that at no given time, should a program occupy the memory if it is not executing or waiting to be executed in the near future.
When memory is occupied by unused program code is wasted and with time, this memory waste is expensive to the operating system.This document highlights details about the Main memory in Operating systems.It will provide a detailed description of the various ways of defining and organizing memory hardware. It will also discuss the various memory management techniques including segmentation and paging.In addition, this document will focus on virtual memory.Giving the benefits of virtual memory in a system as well as the demand concepts, paging, page replacement algorithms and allocation of page frames.
MemoryMemory, meaning main memory or primary memory is often related to semiconductor addressable memory.There are two main types of memory. Volatile and non-volatile Memory.Volatile memory is lost whenever the computer powers down theses are used as primary storage which is typically RAM. Non-volatile memory is that which can retain the data even when power is cycled, for example, flash memory which is used as secondary memory.Computer memory operates at higher speeds, unlike storage which takes a long time to access but has a higher capacity than computer memory.In some instances, the data in computer memory would need to be transferred to a secondary memory this is carried out through virtual memory. (Burrell, 2003)Main memoryThis includes RAM and ROMThe following are the characteristics of main memory: It is relatively expensive to run. A relatively small capacity. High performance. Frequently accessed compared to the secondary memorySecondary memoryThis includes the disk or flash memory.The following are the characteristics of secondary memory: It is cheap. It has a large capacity It is slowMemory OrganizationThis is how memory is organized in a computer.This can be done in different ways including: One process may use the entire memory space. Each process gets its own partition in the memory this can be dynamically or statically allocated.Main memory requires careful management because it is scarce in comparison to the secondary memory.Memory hardware hierarchy Figure 1 memory hierarchy (brightWays, 2014)This can also be described as 3 types of memory.Cache memory, main memory, and secondary memory respectively.The cache memory is a fast memory and it is found in the processor. Information that is gotten to every now and again can be put away in the store for quicker access. Current directions are put in the main memory. Secondary memory stores information that is not effectively required before a program runs, it must be moved from the secondary memory to the main memory. The Diagram above we consider that that as we move up the memory hierarchy the expense of the memory equipment incrementsMemory managementThe principle of memory management is ensuring optimal memory performance.This is done by the memory manager. The memory manager controls the following tasks,Decides which process stays within the memory space, how much memory will be allocated to each process, and Where in the memory will each computer process go.Memory management strategiesThe strategies can be divided into the following categories. Placement strategyIt decides where in the main memory to place the incoming data. Replacement strategyThis decides which data to remove from the main memory in order to make more space for the incoming data. This is an instance when there isn’t enough memory, the data that is replaced for the incoming data is placed in the secondary memory. Fetch strategyIt demands the data then makes a decision on which data to load next to the main memory. (Remzi H. Arpaci-Dusseau, 2018)Memory management techniquesHow Far We Are with Various Techniques?Memory can be managed in Either uniprogramming or multiprogramming.In this document, I will focus on the memory management techniques that are used in multiprogramming. Contiguous AllocationThis is a method of organizing programs in computer memory. Here the program must exist in a single block of a contiguous address. At times it is impossible to find a block that is large enough to accommodate the entire program block. This has low overhead.Multiprogramming with fixed partitionsThe main memory is divided into a number of static partitions at system generation time. This can be either equal or unequal. The fixed partitioning placement algorithm can be done in the following ways.The first option is to divide the new process into multiple queues and to place those queues in different partitions in the main memory. The second option is to make the new process a single queue that occupies all the partitions in the main memory.AdvantagesSimple to implementMinimal Operating system overheadsDisadvantagesInefficientThe maximum number of active processes is fixed.Multiprogramming with variable numbers of partitionsThe main memory is divided into a number of partitions dynamically.Each process is loaded in a partition of exactly the same size of the process.There are the following placement algorithms.First fit-The first memory partition that is big enough is allocated to the programBest fit -The smallest partition that the program can fit in is allocated firstWorst fit-The largest partition that the program can fit in is allocated to the program.Non-Contiguous Allocation (Virtual memory)Programs are divided into small partitions known as segments. Each segment can be set in various parts of the PC memory this is known as dynamic allocation. This makes it simpler for the segments to discover memory that can suit the procedure. This tackles the overhead issue that is brought about by the contiguous memory allocation. Virtual memory gives the illusion of a bigger memory. The client is given the feeling that the whole program is in the RAM. AdvantagesThe utilization of virtual memory permits decoupling virtual addresses from physical locations. These don’t need to be encoded utilizing a similar number of bits. Furthermore, it enables us to share the memory between processes. It additionally permits full use of the CPU power. The lastly, utilization of virtual memory makes it conceivable to consolidate together the RAM and at least one or more storage devices, for example, hard disks or SSDs to shape a virtual memory of a more noteworthy limit than the RAM accessible. Detriments May cause internal discontinuity of computer memory. Causes longer memory access times Causes inverted page tables.PagingVirtual memory is used. Computer memory is broken into several blocks of the same size. Figure 2 Paging explainedWhen paging, the physical and logical memory spaces are separated into equivalent estimated blocks. These are known as frames and the fixed-measure logical blocks are pages. At the point when processes are executing pages of logical memory space are put into the frames of the physical in the memory address space. Addresses produced to get to the frames are partitioned into two sections known as offset and the page number.Demand paging- In this version of paging, Pages are only loaded as they are requested as opposed to being generated before time.SegmentationA new process is divided into segments of a certain size and loaded into the logical memory address space. Each segment is named and allocated size during execution, the segments of the logical memory space are loaded into the physical memory space.The user specified address contains the name of the segment and the offset. These segments are indexed and referenced by the segment number instead of the name. The number that is allocated is used as an index in the segment table and the offset shows the length of a segment. The segment number and offset together make up the segment address in the physical memory space.Other memory management strategiesFragmentationAt whatever point a procedure is deleted or loaded from the physical memory block; it makes an ‘opening’ in the memory space called a fragment. Fragmentation makes the computer experience issues in apportioning contiguous memory space to processes. Fragmentation is characterized in two internal and external.Internal fragmentation.This happens when fixed sizes of memory blocks are distributed to processes when the memory assigned to the process is somewhat greater than the memory requested by the procedure, this makes free space in the allotted block, causing internal fragmentation. The recommendation is: the memory must be divided into blocks of differing sizes and allot the best block to the procedure.External fragmentationThis occurs when the memory space of variable size is dynamically allocated to processes.When the process is removed from memory, it creates free space in the memory causing external fragmentation. The solution:Paging and segmentationSwappingswapping is a part of ordinary computer tasks. It is imperative to give sharp thoughtfulness regarding excessive swapping this is on the grounds that it can cause inconveniences if the accompanying occasions happen more than once: Pages of a process are traded; the process can run and attempts to get to an exchanged page the page is restored (perhaps driving the emptying of pages from different processes) A little later this page is traded again If this arrangement of occasions is general Internal Fragmented (it is called collapse or thrashing) it shows that the measure of RAM is lacking to adapt to the present outstanding task at hand. The collapse has a negative effect on system performance since the CPU and I/O that can result from such a circumstance immediately surpass the heap forced by the genuine work of a framework. In extraordinary cases, the framework may not play out any helpful work and hoard every one of its assets for moving pages to and from memory. References1. brightWays. (2014). Computer organization notes. Retrieved from brightWays: Burrell, M. (2003). Fundamentals of Computer Architecture. Macmillan International Higher Education.3. Hayes, J. P. (1998). Computer architecture and organization. WCB McGraw-Hill.4. Remzi H. Arpaci-Dusseau, A. C.-D. (2018). Operating Systems: Three Easy Pieces. CreateSpace Independent Publishing Platform.
Cite this essay
Course Operating systemsTitle Memory and Memory ManagementAuthor Abigail SyanwaAdmission Number 99270Lecturer Mr. (2019, Aug 20). Retrieved from https://studymoose.com/course-operating-systemstitle-memory-and-memory-managementauthor-abigail-syanwaadmission-number-99270lecturer-mr-essay
This is just a sample. You can get your custom paper from our
Rate this post Part 4 begins with another attempt from the Wedding Guest to get away, shown through the direct speech of the Wedding Guest, ‘I FEAR thee, ancient Mariner! ’ The direct speech is also used to remind us that the Mariner is telling a story within the poem. The capitalisation of the word,...
Rate this post Company Summary: Harley-Davidson is one of two American producers of motorcycles, and the nation’s #1 seller of the cruiser style of motorcycles. The organization offers 35 different models of custom and touring bikes through a worldwide network of more than 1,500 dealers. Harley models include the Sportster, the Fat Boy, and the...
Rate this post Styles of Love and Solitude function in a few of the most well-known art pieces worldwide, such as The Kiss (Gustav Klimt) and The Subway (George Tooker). Artists use specific approaches to stimulate certain emotions. Roy Lichtenstein and René Magritte are world-renowned artists both understood for various art styles and different views...
Rate this post The name Romeo, in popular culture, has become synonymous with “lover”. Romeo Montague, in William Shakespeare’s ‘Romeo and Juliet’ does indeed experience a love of such purity and passion which drives him to death, when he believes the object of his love, Juliet Capulet, has died. Emotions and changes are conveyed in...
Rate this post This project is an attempt to reduce the toxic content of diesel exhaust, before it is emitted to the atmosphere. This system can be safely used for diesel power packs which could be used in inflammable atmospheres, such as refineries, chemicals processing industries, open cost mines and other confined areas, which demands...
Not Finding What You Need?
Search for essay samples now
Copying content is not allowed on this website
Ask a professional writer to help you with your text