MEMORY MANAGEMENT
MEMORY MANAGEMENT
ARCHITECTURE
MEMORY MANAGEMENT
BASIC CONCEPTS
• SRAM full form is Static Random Access Memory. It possesses an array of flip-flops
that are used to save the data. The memory cells consists of flip flops that hold the
information till the power supply is on.
• The word static implies that the memory holds its contents as long as the electricity
is being supplied and the data is dumped when the power gets down because of its
volatile nature.
• Static RAM”s are more expensive and consume more power and also have higher
speeds than D-RAMs.
• Static RAM is used to build the CPU”s speed-sensitive cache, while dynamic RAM
forms the larger system RAM space.
DYNAMIC RAM (DRAM)
• DRAM (Dynamic Random Access Memory) stores the data in the form of charges in
the capacitor and transistor pair available in the memory cell . DRAM is
implemented using MOSFETs.
• The Dynamic Random Access Memory needs to be regularly refreshed so that the
data should be maintained. This is achieved by installing the memory on a refresh
circuit that rewrites the content several hundred times every second. It dissipates
less power ass compared to SRAM and operates at a slower rate than as well.
• DRAM is installed for system memory as it is relatively cheap and small. It consists
of memory cells, which constitute a single capacitor and a single transistor.
ROM
• ROM stands for Read-Only Memory. It is a non-volatile memory that is used to stores
important information which is used to operate the system. As its name refers to
read-only memory, we can only read the programs and data stored on it. It is also a
primary memory unit of the computer system. It contains some electronic fuses that
can be programmed for a piece of specific information. The information stored in
the ROM in binary format. It is also known as permanent memory.
• TYPES OF ROM:
Disadvantages of ROM:
• It is a read-only memory, so it cannot be modified.
• It is slower as compared to RAM.
Difference RAM ROM
Read/Write Read and write operations are supported Only read operations are supported
A RAM chip can store only a few gigabytes A ROM chip can store multiple megabytes (MB) of
Chip Size
(GB) of data. data.
Used for temporary storage of data currently Used to store firmware, BIOS, and other data that
Function
being processed by CPU needs to be retained
PERFORMANCE CONSIDERATION
• Computer performance is the amount of work accomplished by a
computer system. The word performance in computer performance means
“How well is the computer doing the work it is supposed to do?”. It basically
depends on response time, throughput and execution time of a computer
system.
• Response time is the time from start to completion of a task. This also
includes:
i. Operating system overhead.
ii. Waiting for I/O and other processes
iii. Accessing disk and memory
iv. Time spent executing on the CPU or execution time.
Performance is determined by execution time as performance is inversely proportional to execution
time.
If given that Processor A is faster than processor B, that means execution time of A is less than that of
execution time of B. Therefore, performance of A is greater than that of performance of B.
Example –
Machine A runs a program in 100 seconds, Machine B runs the same program in 125 seconds
When a program gets swapped out to a disk memory, then it is not always possible
that when it is swapped back into main memory then it occupies the previous
memory location, since the location may still be occupied by another process. We
may need to relocate the process to a different area of memory. Thus there is a
possibility that program may be moved in main memory due to swapping.
• Protection – There is always a danger when we have multiple programs at
the same time as one program may write to the address space of another
program. So every process must be protected against unwanted interference
when other process tries to write in a process whether accidental or incidental.
• Between relocation and protection requirement a trade-off occurs as the
satisfaction of relocation requirement increases the difficulty of satisfying the
protection requirement.
• For example, multiple processes may use the same system file and it is natural to
load one copy of the file in main memory and let it shared by those processes.
• It is the task of Memory management to allow controlled access to the shared areas
of memory without compromising the protection. Mechanisms are used to support
relocation supported sharing capabilities.
• Logical organization – Main memory is organized as linear or it can be a one-
dimensional address space which consists of a sequence of bytes or words. Most of
the programs can be organized into modules, some of those are unmodifiable (read-
only, execute only) and some of those contain data that can be modified.
• To effectively deal with a user program, the operating system and computer
hardware must support a basic module to provide the required protection and
sharing.
Advantages:
• Modules are written and compiled independently and all the references from one
module to another module are resolved by `the system at run time.
• Different modules are provided with different degrees of protection.
• There are mechanisms by which modules can be shared among processes. Sharing
can be provided on a module level that lets the user specify the sharing that is
desired.
• Physical organization – The structure of computer memory has two levels referred
to as main memory and secondary memory. Main memory is relatively very fast and
costly as compared to the secondary memory. Main memory is volatile. Thus
secondary memory is provided for storage of data on a long-term basis while the
main memory holds currently used programs.
• The major system concern between main memory and secondary memory is the
flow of information to understand this for two reasons:
• The programmer may engage in a practice known as overlaying when the main
memory available for a program and its data may be insufficient. It allows
different modules to be assigned to the same region of memory. One
disadvantage is that it is time-consuming for the programmer.
• In a multiprogramming environment, the programmer does not know how
much space will be available at the time of coding and where that space will be
located inside the memory.
SECONDARY STORAGE
• Secondary storage is computer memory that is not directly accessible to the CPU of a
computer, requiring the use of computer’s input/output channels.
• It is used to store data that is not in active use.
• It is usually slower than primary storage but it always has higher storage capacity.
• It is non-volatile. Data remains unchanged even after switching off the computer.
FIXED STORAGE
• In secondary memory, a fixed storage is an internal media device that is used to store data
in a computer system. Fixed storage is generally known as fixed disk drives or hard drives.
• Generally, the data of the computer system is stored in a built-in fixed storage device.
• Fixed storage does not mean that you can not remove them from the computer system,
you can remove the fixed storage device for repairing, for the upgrade, or for maintenance,
etc. with the help of an expert or engineer.
Types of fixed storage:
Following are the types of fixed storage:
• Internal flash memory (rare)
• SSD (solid-state disk)
• Hard disk drives (HDD)
SECONDARY STORAGE DEVICES