

{"id":91337,"date":"2021-04-20T09:00:46","date_gmt":"2021-04-20T03:30:46","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=91337"},"modified":"2021-04-28T12:03:41","modified_gmt":"2021-04-28T06:33:41","slug":"memory-management-in-computer","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/","title":{"rendered":"Basics of Memory Management in Computer"},"content":{"rendered":"<p>Computer memory is the data collection of a device in binary format. Binary language is what the machine understands and thus the computer converts every data into binary language before storing it in memory. This is how the computer stores data.<\/p>\n<p>And the device capable of storing data for the short term or long term becomes a storage device. To ensure a device can optimize overall system performance, the function of memory management comes in place.<\/p>\n<p>It is responsible for coordinating and monitoring the memory by assigning blocks to various programs on the device. It keeps a record of all the file locations despite the process of saving them. This decides the space that each file needs on the device and updates all additions and deletions of the files.<\/p>\n<p>It is present everywhere in the device, the hardware, the operating system, and in all the programs as well. In the case of hardware, there is physical storing of data like RAM, memory chips, caches, and drives. For an operating system, its main role is to assign blocks to each program.<\/p>\n<p>The memory management in applications, the function is to ensure that there is a proper data structure with adequate space for smooth running. Allocation and recycling are the two tasks in the applications. Allocation is to assign blocks to the program while recycling is when the previous data is no longer needed, the same is reassigned to another program.<\/p>\n<h3>Why Use Memory Management?<\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">It makes sure that every process gets an ideal amount of memory and at the right time.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">It updates the system by checking the inventory\u2019s status as vacant or engaged.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Provides space to application routines<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Coordinates to avoid interference between applications<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Protects processes from each other<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Ensures memory utilization by placing programs in the memory<\/span><\/li>\n<\/ul>\n<h3>Requirements of memory management<\/h3>\n<h4>1. Relocation<\/h4>\n<p>There are many files and processes that exist together as a multiprogramming system, but it&#8217;s hard to know if a program will be in the memory during execution. Swapping is the main concept here which we study in detail below.<\/p>\n<p>Swapping enables the operating system to have a better execution of the process. But this process after removing an item from the main memory, and the chances of it getting the same location at return are very less. Thus the idea of relocation becomes important.<\/p>\n<h4>2. Protection<\/h4>\n<p>Storing many processes together leads to a mix up in writing the address. This causes interference between the programs affecting their functioning. Thus every process needs protection from these kinds of situations.<\/p>\n<p>Memory cannot predict the locations thus the absolute address is not accessible too. There is a dynamic calculator during the execution by the processor checking the validity of memory references.<\/p>\n<h4>3. Sharing<\/h4>\n<p><span style=\"font-weight: 400;\">There is sharing in the main memory by many processes allowing them to access the same copy of the programs instead of having an unique one. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">The memory management allows control over shared areas of memory while protecting them. The relocation is in a way to support sharing capabilities.<\/span><\/p>\n<h4>4. Logical organization<\/h4>\n<p><span style=\"font-weight: 400;\">The main memory follows a linear organisation with one-dimensional address space made of bytes or words. They may be editable or readable only but an effective operating system and computer hardware sports all basic modules. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">They are ideal because &#8211;\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Each module is independent and only the system resolves the references between them.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">There is a different degree of protection for each module.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The mechanism allows sharing of modules with a program allowing users to experiment.\u00a0<\/span><\/li>\n<\/ul>\n<h4>5. Physical organization<\/h4>\n<p>There is a physical organisation between the main and the secondary memory. Main one faster and costlier but the secondary is long term and non volatile. The flow of information between the two is very important for the programmer as they may engage in overlaying during insufficient space in the memory.<\/p>\n<p>Many modules can stay in the same region of the memory. But it is time consuming for the user as they are unaware about the space inside the memory and the coding time.<\/p>\n<h3>Computer Memory Allocation<\/h3>\n<p><span style=\"font-weight: 400;\">The main memory of the device usually has a partition. There is <\/span><span style=\"font-weight: 400;\">low memory<\/span><span style=\"font-weight: 400;\"> where the operating system functions. And there is <\/span><span style=\"font-weight: 400;\">high memory<\/span><span style=\"font-weight: 400;\"> for user processes. The operating system has two mechanisms for memory allocation &#8211;\u00a0<\/span><\/p>\n<h4>1. Single-partition allocation<\/h4>\n<p><span style=\"font-weight: 400;\">This type of mechanism follows a relocation-register scheme to protect the user\u2019s processes while changing code and data on the system. The smallest value logical address goes to the relocation register while the range of these addresses goes to the limit register.\u00a0<\/span><\/p>\n<h4>2. Multiple-partition allocation \/ Contiguous Memory Allocation<\/h4>\n<p>Here, there are fixed space partitions of the main memory and each of them has only one process. When there is a vacant partition, the process from the input gets uploaded here.<\/p>\n<p>And once this process terminates, the partition becomes vacant again. The holes are the free block in the memory and each of them undergoes a test to see their capability before assignment.<\/p>\n<p>They are of three types &#8211;<\/p>\n<ol>\n<li style=\"font-weight: 400;\"><b>First Fit<\/b><span style=\"font-weight: 400;\"> &#8211; It is the first hole with a large size for program allocation.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>Best Fit <\/b><span style=\"font-weight: 400;\">&#8211; It is the smallest hole with a large size for program allocation.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>Worst Fit <\/b><span style=\"font-weight: 400;\">&#8211; It is the largest hole with a large size for program allocation.<\/span><\/li>\n<\/ol>\n<h3>Process Address Space<\/h3>\n<p>The logical space set is a process address with references in its code. An address with 32 bits can be in the range of 0 to 0x7fffffff with 2^31 possible numbers of 2 gigabytes size. The process of mapping a logical address to a physical one during allocation is by the operating system. The addresses are of three types &#8211;<\/p>\n<p><strong>Symbolic addresses<\/strong> &#8211; the source code is the address with variable, constant, and instruction labels in the address space.<br \/>\n<strong>Relative addresses<\/strong> &#8211; The compiler converts the symbolic address into relative during the compilation.<br \/>\n<strong>Physical addresses<\/strong> &#8211; The loaders make these during program loading in the memory.<\/p>\n<p>During compilation and loading, virtual and physical addresses are the same and are different during execution-time and address-binding schemes. All the logical addresses that a program generates are logical address spaces.<\/p>\n<p>The Memory Management Unit takes care of transferring virtual addresses to a physical one using certain mechanisms. The base register has all user-generated addresses, the users only interact with virtual addresses and not the physical ones.<\/p>\n<h3>Loading in Memory<\/h3>\n<p><span style=\"font-weight: 400;\">The process of transferring secondary memory to main memory is Loading. It is mainly of two types, static loading, and dynamic loading. The decision of either one comes during computer program development.\u00a0\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><b>static loading<\/b><span style=\"font-weight: 400;\"> compiles programs without leaving any external program or module dependency. There is linking of object programs with other necessary object modules creating an absolute program with logical addresses. At the loading stage, the absolute program needs to be in memory for final execution.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In the case of <\/span><b>dynamic loading<\/b><span style=\"font-weight: 400;\">, the compiling is done for all the modules with only references, and the rest is done during execution. The dynamic routes of the library enter the memory through a relocatable disk only when the program needs it.\u00a0<\/span><\/p>\n<h3>Linking<\/h3>\n<p><span style=\"font-weight: 400;\">Enabling program execution, linking brings together modules or the functions of the program. It is also of two types &#8211; static linking and dynamic linking. The <\/span><b>static linking <\/b><span style=\"font-weight: 400;\">leads to combining all the modules of the program into one executable document to save users from runtime dependency.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">While <\/span><b>dynamic linking<\/b><span style=\"font-weight: 400;\">, instead of compiling all the programs, a reference to the dynamic module is there during compilation and linking. Dynamic Link Libraries and Shared Objects are a few examples of dynamic libraries.<\/span><\/p>\n<h3>Swapping<\/h3>\n<p>The process of removing a process temporarily out of the main memory to secondary storage and making it accessible for a new process is swapping.<\/p>\n<p>After the work is done, the original process goes back to the main memory. This impacts the device performance but helps to run multiple and processes in parallel. The time is taken to do this process from the start till the end is process swapping.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image01.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-92457\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image01.jpg\" alt=\"Swapping in COmputer\" width=\"1600\" height=\"1700\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image01.jpg 1600w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image01-282x300.jpg 282w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image01-964x1024.jpg 964w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image01-141x150.jpg 141w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image01-768x816.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image01-1446x1536.jpg 1446w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image01-720x765.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image01-520x553.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image01-320x340.jpg 320w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><\/a><\/p>\n<p><strong>For example &#8211;<\/strong><\/p>\n<p>Process Size &#8211; 2048KB<br \/>\nTransfer Rate &#8211; 1 MB\/per second.<br \/>\nActual Transfer &#8211; 1000K<\/p>\n<p>2048KB \/ 1024KB per second<br \/>\n= 2 seconds<br \/>\n= 2000 milliseconds \/ one way<\/p>\n<p>Some of its benefits are &#8211;<\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">High degree of multiprogramming<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Can follow a dynamic location leading to better functioning<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Efficient use of the memory<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Follows priority based schedule improving performance<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">There is minimum wastage of CPU<\/span><\/li>\n<\/ul>\n<h3>Fragmentation<\/h3>\n<p><span style=\"font-weight: 400;\">In the process of loading and removing, the free space in the memory gets into pieces. After a point, these pieces don&#8217;t accept any processes due to their small size and memory blocks. This problem is called fragmentation.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image02.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-92459\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image02.jpg\" alt=\"Fragmentation in Computer\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image02.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image02-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image02-1024x536.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image02-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image02-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image02-720x377.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image02-520x272.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image02-320x167.jpg 320w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">It is of two types &#8211; External fragmentation and Internal fragmentation.\u00a0<\/span><\/p>\n<h4>1. External fragmentation<\/h4>\n<p><span style=\"font-weight: 400;\">It has enough memory space for process residence but it is not contiguous becoming useless. Compaction of all free memory together in a block can reduce this.\u00a0<\/span><\/p>\n<h4>2. Internal fragmentation<\/h4>\n<p><span style=\"font-weight: 400;\">It is when the process gets a bigger block than needed leaving extra space left unused. Effective assigning of the process into a small partition but enough for it can reduce this problem as well.\u00a0<\/span><\/p>\n<h3>Paging<\/h3>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image03.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-92460\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image03.jpg\" alt=\"Paging in Computer\" width=\"1500\" height=\"1200\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image03.jpg 1500w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image03-300x240.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image03-1024x819.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image03-150x120.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image03-768x614.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image03-720x576.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image03-520x416.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image03-320x256.jpg 320w\" sizes=\"auto, (max-width: 1500px) 100vw, 1500px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">The computer can manage more memory than the physically installed one on the device. This extra memory is virtual memory and paging is a technique to manage it. This technique breaks process address space in same-size blocks called <\/span><b>pages<\/b><span style=\"font-weight: 400;\">. Similarly, <\/span><b>frames <\/b><span style=\"font-weight: 400;\">are the same size blocks of the main memory.\u00a0<\/span><\/p>\n<p><b>The page address<\/b><span style=\"font-weight: 400;\"> is the same as the logical address and has a page number and offset of representation. \u00a0 Ie. Logical Address = Page number + page offset. <\/span><b>The frame address<\/b><span style=\"font-weight: 400;\"> is the same as the physical address and has a frame number and offset for representation. Ie. Physical Address = Frame number + page offset<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A data structure is there to monitor the relation between pages and frames in memory. This structure is a <\/span><b>page map table<\/b><span style=\"font-weight: 400;\">. The system allocates a frame to every page translating a logical address into a physical one. During the process execution, the pages need to load on vacant frames and this shall continue till the execution completes.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">There are advantages but certain drawbacks to this method as well. It may control external fragmentation but leads to internal fragmentation. It&#8217;s simple to implement but swapping is easier because of the equal size of the pages and frames. Computers with small RAM cannot function with a page table.\u00a0<\/span><\/p>\n<h3>Segmentation<\/h3>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image04.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-92461\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image04.jpg\" alt=\"Segmentation in Computer\" width=\"1500\" height=\"1200\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image04.jpg 1500w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image04-300x240.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image04-1024x819.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image04-150x120.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image04-768x614.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image04-720x576.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image04-520x416.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-MEmory-Management-image04-320x256.jpg 320w\" sizes=\"auto, (max-width: 1500px) 100vw, 1500px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Dividing each job into several segments of different sizes with each module having a function is segmentation. Every segment has a different logical address space and they go in non-contiguous memory during execution. It is very similar to paging but has different-sized pages, unlike paging.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It has the program&#8217;s main function, utility functions, data structures, etc with a segment map to coordinate everything. For each segment, the starting address and its length are what the table stores. There is also a reference to the memory location of the segment and offset. <\/span><\/p>\n<p><b>Segmentation with Paging<\/b><span style=\"font-weight: 400;\"> is an ideal combination that leads to each segment divided into pages and they all go in the page table. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">In this, the logical address has 3 parts :<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Segment numbers(S)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Page number (P)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The offset number (D)<\/span><\/li>\n<\/ol>\n<h3>Memory Protection<\/h3>\n<p><span style=\"font-weight: 400;\">Controlling the memory access rights on the device to prevent processes from accessing it without allocation refers to memory protection. This protects the memory from bugs, storage violations, segmentation faults, and killing the process.<\/span><\/p>\n<h3>Memory life cycle<\/h3>\n<p><span style=\"font-weight: 400;\">The basic life cycle of any process looks like this &#8211;\u00a0<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Allocation of Memory\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Make use of the allocated memory\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Remove the allocated memory when done\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Make space for a new process and the same repeats<\/span><\/li>\n<\/ol>\n<p>Allocation in JavaScript is a bit different. There is value initialization where JavaScript automatically allocates memory to declared values. Then there is using values, that is to read and write in the memory using variables or object property.<\/p>\n<p>After this, the allocated memory is released because it&#8217;s not needed anymore. The developer takes this call after evaluation in case of a low-level language. But in high memory language, there is a garbage collector, an automatic memory manager.<\/p>\n<h3>Issues in Memory Management<\/h3>\n<h4>Relocation and Address Translation<\/h4>\n<p><span style=\"font-weight: 400;\">During address translation, the exact location of the physical memory remains unknown. The compiler assumes that the program will load from memory location x and at runtime it may relocate. This creates confusion in the address book.\u00a0<\/span><\/p>\n<h4>Protection<\/h4>\n<p>There are no laid down measures to avoid interference of multiple programs. The compiler ensures to generate different addresses and relocation but hardware malfunction may lead to interference.<\/p>\n<h4>Sharing and Evaluation<\/h4>\n<p>Unlike protection, many processes may end up at the same memory location. There are very few norms to evaluate the efficiency of the memory management scheme like wasted memory, access time, and complexity.<\/p>\n<h3>Conclusion<\/h3>\n<p>The memory management for most of us was just till hard drives and internal memory of our devices. But as we learned, it is a lot more than that. The functioning of the units to manage the memory is quite complex and your basics must be clear to understand that.<\/p>\n<p>The article covers all elements of basic memory management for competitive exams like the RRB exam, IBPS exam. SBI Exam, etc. All these exams have computer aptitude in their syllabus making it important for all applicants to study this topic.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Computer memory is the data collection of a device in binary format. Binary language is what the machine understands and thus the computer converts every data into binary language before storing it in memory.&#46;&#46;&#46;<\/p>\n","protected":false},"author":7,"featured_media":92456,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24027],"tags":[24049,24050,24051,24052,24053,24054],"class_list":["post-91337","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computer-basics-tutorials","tag-basics-of-memory-management-in-computer","tag-computer-memory-management","tag-fragmentation-in-computer","tag-paging-in-computer","tag-segmenttation-in-computer","tag-swapping-in-computer"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Basics of Memory Management in Computer - DataFlair<\/title>\n<meta name=\"description\" content=\"Memory refers to a physical memory that is the internal memory to the computer. Learn more about memory management, swapping, paging etc\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Basics of Memory Management in Computer - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Memory refers to a physical memory that is the internal memory to the computer. Learn more about memory management, swapping, paging etc\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-20T03:30:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-28T06:33:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-Memory-Management.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Basics of Memory Management in Computer - DataFlair","description":"Memory refers to a physical memory that is the internal memory to the computer. Learn more about memory management, swapping, paging etc","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/","og_locale":"en_US","og_type":"article","og_title":"Basics of Memory Management in Computer - DataFlair","og_description":"Memory refers to a physical memory that is the internal memory to the computer. Learn more about memory management, swapping, paging etc","og_url":"https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2021-04-20T03:30:46+00:00","article_modified_time":"2021-04-28T06:33:41+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-Memory-Management.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/beb0cab24b7aa54423a3b50e669a9dcd"},"headline":"Basics of Memory Management in Computer","datePublished":"2021-04-20T03:30:46+00:00","dateModified":"2021-04-28T06:33:41+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/"},"wordCount":2208,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-Memory-Management.jpg","keywords":["Basics of Memory Management in Computer","Computer memory management","Fragmentation in Computer","Paging in Computer","Segmenttation in Computer","Swapping in Computer"],"articleSection":["Computer Basics Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/","url":"https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/","name":"Basics of Memory Management in Computer - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-Memory-Management.jpg","datePublished":"2021-04-20T03:30:46+00:00","dateModified":"2021-04-28T06:33:41+00:00","description":"Memory refers to a physical memory that is the internal memory to the computer. Learn more about memory management, swapping, paging etc","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-Memory-Management.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/04\/Basics-of-Memory-Management.jpg","width":1200,"height":628,"caption":"Basics of Memory Management in COmputer"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/memory-management-in-computer\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Basics of Memory Management in Computer"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/beb0cab24b7aa54423a3b50e669a9dcd","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team specializes in creating clear, actionable content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Backed by industry expertise, we make learning easy and career-oriented for beginners and pros alike.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam3\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/91337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=91337"}],"version-history":[{"count":2,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/91337\/revisions"}],"predecessor-version":[{"id":92462,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/91337\/revisions\/92462"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/92456"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=91337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=91337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=91337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}