➢ Contiguous Memory Allocation
Definition:
In contiguous memory allocation, a process is allocated a single continuous block of memory.
This means all the memory required by a process is stored in one sequential section of the
physical memory.
Types:
• Fixed Partitioning:
The memory is divided into fixed-size partitions at system startup. Each partition can
hold one process. If a process does not fully utilize its partition, the remaining space
cannot be used by other processes, leading to internal fragmentation.
• Dynamic Partitioning:
Memory is allocated in variable-sized blocks based on the process's needs. When a
process is loaded, the operating system finds a suitable free block of memory and
allocates it to the process.
➢ Fixed-size Partition Scheme
In this type of contiguous memory allocation technique, each process is allotted a fixed-size
continuous block in the main memory. That means there will be continuous blocks of fixed
size into which the complete memory will be divided, and each time a process comes in, it will
be allotted one of the free blocks. Because irrespective of the size of the process, each is allotted
a block of the same size memory space. This technique is also called static partitioning.
,➢ Variable-size Partition Scheme
In this type of contiguous memory allocation technique, no fixed blocks or partitions are
made in the memory. Instead, each process is allotted a variable-sized block depending upon
its requirements. That means, that whenever a new process wants some space in the memory,
if available, this amount of space is allotted to it. Hence, the size of each block depends on the
size and requirements of the process which occupies it.
➢ Logical and Physical Address Space in OS
A logical address in an operating system is also known as a virtual address. It represents a
location in the computer's memory from the perspective of the executing process. These
addresses are generated by the CPU during program execution. Logical addresses are used by
programs to access data and instructions stored in memory.
A physical address is the actual location in the computer's memory hardware, such as RAM
or a storage device. Unlike logical addresses, which are generated by the CPU for processes,
physical addresses are fixed and represent the true location of data in memory.
➢ Memory-Management Unit
The Memory Management Unit (MMU) is a crucial component of a computer's architecture
that manages the translation between logical addresses (used by programs) and physical
addresses (used by the hardware).
The MMU translates logical addresses generated by the CPU into physical addresses in RAM.
The MMU enforces access controls, ensuring that one process cannot access the memory space
of another process.
The MMU enables the implementation of virtual memory, allowing the system to use disk
space as an extension of RAM.
, ➢ Difference between Logical and Physical Address in OS
Difference Logical Address Physical Address
Represents the actual
Generated by the CPU during location in memory
Definition program execution, representing a hardware, pointing directly
process's view of memory. to data in hardware
memory.
Managed by the hardware
Managed by the CPU and and remains static during
Responsibility generated for each running program execution,
process, ensuring process isolation. providing stable memory
addressing.
Does not require
Requires translation by the
translation; it directly
memory manager or hardware
Translation represents the data's
before accessing data; it's a virtual
physical location in
address.
memory.
Unique for each storage cell
Unique for each running process,
in memory, providing
Uniqueness allowing processes to run
precise addressing within
independently.
hardware memory.
Allows for dynamic memory Static and does not change
allocation and efficient during program execution,
Flexibility
multitasking as each process has providing memory stability
its own logical address space. and predictability.
Used for process isolation and Typically not employed for
Security protection mechanisms, enhancing security measures in
system security. memory access.
Does not involve a
Address Requires a translation mechanism,
translation mechanism; it
Translation such as page tables, to map logical
directly represents physical
Mechanism addresses to physical addresses.
memory locations.
When a program wants to access When the memory
data, it uses logical addresses to hardware wants to access
Example request data from the OS, which data, it uses the physical
then translates them into physical address to access the data
addresses for memory access. directly from memory.
Vital for implementing virtual Less relevant for virtual
Usage in Virtual
memory systems, allowing memory systems, as logical
Memory
efficient use of limited physical addresses are primarily used
Systems
memory resources. for process isolation.