ATK Solutions Inc.
Online Portfolio Our Products Software Design Website Design Website Promotion Ecommerce Stores Mobile Applications Online Articles Fun Flash Games Contact Us
How a Computer Manages Memory for Running Programs
An operating system is the most important software that runs on a computer. It manages the computer's memory, processes, and all of its software and hardware. Memory management is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs to optimize overall system performance. Memory management resides in hardware, in the OS (operating system), and in programs and applications.

In hardware, memory management involves components that physically store data, such as RAM (random access memory) chips, memory caches, and flash-based SSDs (solid-state drives).

In the operating system, memory management involves the allocation (and constant reallocation) of specific memory blocks to individual programs as user demands change.

Below is a sample program that will simulate how memory is managed by the computer's operating system:



How to Use Memory Manager
STEP 1: Select memory manager algorithm (First Fit, Best Fit, or Worst Fit)

STEP 2: Enter the Total Memory in kilobytes (KB)

STEP 3: Enter the Memory used by the OS in kilobytes (KB)

STEP 4: Select a Program/Process (available P1 to P8)

STEP 5: Enter the Process Memory Size in kilobytes (KB)

STEP 6: Click "Add to Memory" to Update Chart.

* NOTE *: You can also select a Process and Remove from Memory.

* NOTE *: Select "Compact Memory NOW" to readjust the existing processes in memory and free up some RAM!

Memory Manager Algorithms:
First Fit - There may be many holes in the memory, so the operating system, to reduce the amount of time it spends analyzing the available spaces, begins at the start of primary memory and allocates memory from the first hole it encounters large enough to satisfy the request. Using the same example as above, first fit will allocate 12KB of the 14KB block to the process.

Best Fit - The allocator places a process in the smallest block of unallocated memory in which it will fit. For example, suppose a process requests 12KB of memory and the memory manager currently has a list of unallocated blocks of 6KB, 14KB, 19KB, 11KB, and 13KB blocks. The best-fit strategy will allocate 12KB of the 13KB block to the process.

Worst Fit - The memory manager places a process in the largest block of unallocated memory available. The idea is that this placement will create the largest hold after the allocations, thus increasing the possibility that, compared to best fit, another process can use the remaining space. Using the same example as above, worst fit will allocate 12KB of the 19KB block to the process, leaving a 7KB block for future use.

Also visit our article on how a operating system schedules processes.
Share: 
Enter Feedback/Comment for this Article  /  Contact Us


Home / Software Development / Website Design / Bookmark Page / Privacy Policy

Article Copyright © ATK Solutions, Inc. All Rights Reserved