HIRE WRITER

Memory and Memory Management

This is FREE sample
This text is free, available online and used for guidance and inspiration. Need a 100% unique paper? Order a custom essay.
  • Any subject
  • Within the deadline
  • Without paying in advance
Get custom essay

Abstract

For easy implementation it is enough to depend on programmed memory. Be that as it may, when information becomes larger, it is basic to request memory from the pile and oversee.

Regularly, applications that are free from memory spills however every now and again designate and de-distribute dynamic memory show progressive execution debasement in execution in the event that they are continued running for significant lots inevitably may finish in accident. Why this occurs? Intermittent designation and de-assignment of dynamic memory causes load discontinuity. Particularly, if the application distributes little memory lumps. A divided pile may have many free squares, yet these squares are little and non-coterminous.

Introduction

A memory reserves the instructions received by Device. In humans, there are many things to remember, so in computers, memory is available to recall the data. This memory is an integral part of C.P.U. It is also called the main memory of the computer, Internal Memory, or Primary Memory.

Memory management is the capacity of a working framework that handles and oversees essential memory. In the meantime it additionally goes about as the procedure of execution while moving among memory and plate.

Memory Management

Memory management follows all the memory locations of the view; Even if they have been allocated to any process or they are sitting empty. It also checks out the amount of memory that needs to be passed to the process. Whenever a memory is free, i.e. empty after implementing a process, memory management keeps updating its records accordingly.

Below is the explanation of the process of memory management as well as its processes.

Process Address Space

It is a set of some logical addresses and these are the addresses that are in the code of reference process. During the memory assignment in the program, it also oversees to map logical addresses to physical addresses. Here are three types of address before and after the allocation of memory in any program:

Types of address Memory Addresses Description

  • Physical Address The loader generates these addresses when the program loads inside the memory.
  • Symbolic Address This address is used in the source code. Variable names, constraint, and instruction labels – These are the basic address spaces for symbolic addresses.
  • Reserved Addresses At the time of compilation process, a compiler works to convert symbolic addresses to a relative address.

Memory Allocation Methods

There are 3 method of allocating memory:

  • Without division – this is when all the memory is assigned to one process. Multiprogramming may be implemented by swapping.
  • Memory division – free operating memory is divided into blocks assigned to a particular user processes.
  • Usage of virtual memory – one or more virtual address spaces allocated to user processes and without any direct obvious mapping to the physical address space.

Static and Dynamic Linking

When static linking is used, then the linking program creates a program that can be executed and the reason behind doing this is by compiling each of the modules that they need. Removing runtime dependency on the other hand, when dynamic linking is used then there is no need to add a real module or library to the program. Instead, a reference of the dynamic module is given at the time of compilation and linking. Key examples of Dynamic Library are: Dynamic Link Library (DLL) in Windows and Shared Objects in UNIX.

Allocation Algorithms

The role of the allocation algorithm is to choose an appropriate free block in order to allocate it to some user process. Some allocation algorithms include.

First Fit algorithm – first which matches from the list, Best Fit algorithm – the optimal in size from the list, Worst Fit algorithm, Buddies algorithm – memory division into two equal in size blocks.

Virtual memory system consists of at least two memory types:

Small and fast (e.g. operating memory) and big but slow (e.g. disk memory), and moreover of additional hardware and software which enable automatic moving of memory pieces between those memory types. Methods of virtual memory implementation are: paging, segmentation and swapping.  (Gupta, 2009)Memory Management Unit (i.e. MMU) performs memory mapping from physical to virtual address. This is a hardware device. MMU uses the following mechanism to convert virtual address to physical address:

Techniques Used in Memory Management

Swapping in memory management

Swapping is a mechanism in which any process can be temporarily swapped from main memory to secondary storage or that disk and that memory can be made available for other process. After some time, the system again swaps back the process from its disk to its main memory. By the way, the process of swapping affects the performance of the system but it helps to run bigger and more than one process. This is why swapping is also called the compromise of memory compaction.

Paging

This is when the memory is divided into fix size pages. In paging, the data is used which is not in main memory, but it is in data format as virtual memory. Paging is done to access data at a faster speed. The diagram given below, will explain the flow of page checks in main memory.

Where p is a page number, D is an offset address, F is a frame address.

Firstly, the CPU generates a logical address that has two parts; the first part is the page number and the second part is offset.

The page number is used as an index in the page table, which contains the base address of each page. Using the page number as an index, we search the frame address.

When the frame address is received, the offset is added to the frame address and in the end the physical address is generated. This physical address is CPU Is sent back to execution.

Segmentation

Segmentation is when the memory is divided into different size segments. A group of segments is called segmentation, and segments are called logical units like;- function, program, variables, array etc. In segmentation, the data and programs are split into the logical address space, so that we can protect and share the memory. The information of each segment is stored in a table called the global descriptor table (GDT). The memory management of the segmentation is similar to that of the paging. But the size of the segments in the segmentation is not fixed while the size of the pages in paging is fixed.

In conclusion, Memory management is a complex field and there are many ways being developed to make it more efficient. MMU allocate memory to process when needed and de-allocate when processes are done. It determines how memory is allocated, how they will get it and how much they will get it. Virtual memory is nothing but the space given on secondary memory to store the parts of processes.

References

  1. http://www.ia.pw.edu.pl/~tkruk/edu/lecture/eopsy05.pdf. (2010).
  2. Gupta, S. (2009). MEMORY MANAGEMENT AND DEBUGGING TECHNIQUES.
  3. https://graal.ens-lyon.fr/~abenoit/asr15/asr2-cours08.pdf. (n.d.).

 

Cite this paper

Memory and Memory Management. (2020, Nov 30). Retrieved from https://samploon.com/memory-and-memory-management/

FAQ

FAQ

What are the two types of memory management?
The two types of memory management are manual memory management and automatic memory management. Manual memory management involves the programmer manually allocating and deallocating memory, while automatic memory management uses a garbage collector to automatically free up memory when it is no longer needed.
What is meant by memory management?
Memory management is the process of allocating and deallocating memory space for use by programs. It is a crucial part of any operating system.
What is memory management and its functions?
Memory management is the process of allocating and deallocating memory in a computer system. The functions of memory management are to keep track of where memory is allocated, to recycle memory when it is no longer needed, and to provide mechanisms for allocating and deallocating memory.
What is memory management and its types?
Mentoring is particularly important for minorities because it can help to close the achievement gap. A mentor can provide guidance, support, and role modeling to help a young person succeed in school and in life.
We use cookies to give you the best experience possible. By continuing we’ll assume you’re on board with our cookie policy

Hi!
Peter is on the line!

Don't settle for a cookie-cutter essay. Receive a tailored piece that meets your specific needs and requirements.

Check it out