4. 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 OS, memory
management involves the allocation (and constant reallocation) of
specific memory blocks to individual programs as user demands change.
At the application level, memory management ensures the availability
of adequate memory for the objects and data structures of each
running program at all times. Application memory management
combines two related tasks, known as allocation and recycling.
5. Storage Hierarchy
Main Memory
• Cache on Chip (internal cache)
• External Cache memory
• RAM
Secondary Storage
• Hard Disk
Tertiary Storage
• CD ROM
• Floppy
• Tape
Access time decreases
Capacity decreases
Cost increases
6. Alternatively referred to as the physical
storage or the real storage, physical
memory is a term used to describe the
total amount of memory installed in the
computer.
For an example, if the computer has two
64MB memory modules installed, it has a
total of 128MB of physical memory.
Physical memory
7. Virtual Memory
Virtual memory is a technique of executing program
instructions that may not fit entirely in system
memory. This is done by calling instructions as and
when the application requires it. Virtual memory is
implemented by using secondary storage to augment
the main memory. Data is transferred from secondary
to main storage as and when necessary and the data
modified is written back to the secondary storage
according to a predetermined algorithm.
8. 1. Paging
In this approach, physical memory is divided into fixed-size blocks called
frames and the logical memory is divided into the fixed-sized blocks called
pages. The size of a page is same as that of frame. The key idea of this
method is to place the pages of a process into the available frames of
memory, whenever, this process is to be executed. The address mapping is
done by Page table.
9. Swapping
Swapping is the technique of temporarily removing inactive programs from
the main memory of a computer system. An inactive program is one that is
neither executing nor performing an I/O operation.
This may also happen when it is desired to place a higher-priority process in
the memory. A lower priority process may be swapped out so that higher-
priority process may be loaded and executed.
10. Paging
Compare
Swapping
Swapping is when an entire
process is swapped out.
Paging is normal.
Paging refers to making
individual pages of memory.
Swapping happens when the
resource load is heavy and the
entire process is written out
to disk.
11.
12. Segmentation
segmentation is another technique for the
noncontiguous storage allocation. It is different from
paging as it supports users’ view of his program.
For a programmer it might be more relevant to divide
the logical address space of his program into variable
sized segments (with respect to his view of main
program, subroutines, data, etc.) than to divide it into
fixed size pages. Such variable sized segments, which
are a collection of logically related information, are the
basis of segmentation technique.