0% found this document useful (0 votes)
22 views16 pages

Ptech GRP 5

Uploaded by

James Bacolod
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views16 pages

Ptech GRP 5

Uploaded by

James Bacolod
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

MEMORY

MANAGEMENT
Memory
Memory management is the functionality of
Management
an operating system (OS) that manages the
primary memory, which includes the
movement of processes back and forth
between the main and the secondary
memory during execution. Memory
management tracks every memory location,
whether it is allocated or free, and checks
the amount of memory to be allocated for
each process. It also facilitates the process
allocation and correspondingly updates the
memory status.
Types of addresses used in a program before and
after memory allocation:

ADDRESSES
These are the addresses used in a
Symbolic source code. The variable names,
Addresses constants, and instruction labels are the
basic elements of a symbolic address
space.
These are the addresses at the time of
Relative compilation. A compiler converts
Addresses symbolic addresses into relative
addresses

These addresses are generated by the


Physical loader when a program is loaded into the
Adderesses main memory.
The following are the commonly used terms in
memory management: This pertains to a fixed-length block of
Frame
main memory

This refers to a fixed-length block of data that


Page resides in the secondary memory. A page of data
may temporarily be copied into a frame in the

TERMS
main memory
A variable-length block of data that resides in the
Segment
secondary memory.

It is a mechanism in which a process can be


Swapping swapped temporarily out of the main memory to
the secondary memory in order to make
memory space available for other processes. It is
also occurs
This known due
as memory compaction.
to the continuous loading and
removal of processes in the memory, wherein
Fragmentation free memory spaces are broken down into
smaller fragments. This happens when processes
cannot be allocated to memory blocks because
The following are the commonly used terms in
memory management:
External This occurs when the allotted memory
fragmentation blocks are of varying sizes. This builds
up due to the continuous removal of
processes in the main memory.

TERMS
This occurs when the allotted memory blocks are
Internal of fixed size, and specific processes need more
fragmentation – space or less space than the size of the allotted
memory block
The following are the requirements that memory
management intends to satisfy:
It is not possible for a programmer to know in

REQUIREMENTS
Relocation advance which programs will reside in the main
memory at the exact time of the program
execution. Hence, the possibility that the program
may be moved within the main memory due to
swapping should always be considered.
Each process should be protected against
Protection unwanted interference by other processes,
whether accidental or intentional. Thus, programs
in other processes should not be able to reference
memory locations in a process, for reading or
writing purposes, without permission.
Any protection mechanism must have the
Sharing
flexibility to allow several processes to access the
same portion of the main memory. If a number of
processes are executing the same program, it is
advantageous to allow each process to access the
same copy of the program rather than have its
own separate copy.
The following are the requirements that memory
management intends to satisfy:
Most programs are organized into modules, some

REQUIREMENTS
Logical of which are unmodified, read-only or execute-
organization only, and some of which contain data that are
modifiable.
The task of moving and organizing information flow
Physical between the main and the secondary memory
organization should be a system responsibility.

This is a volatile memory that provides fast access


Main memory
at a relatively high cost. The main memory
technically holds programs and data that are
currently in use.
This is usually a non-volatile memory at a cheaper
Secondary
cost with slower access. A secondary memory of
memory
large capacity is a good storage of programs and
data for a longer term.
MEMORY
PARTITIONING
TECHNIQUES
Fixed
Partitioning
The main memory is divided into a number of static
partitions at system generation time, wherein a
process may be loaded into a partition of equal or
greater size. Nowadays, the use of fixed partitioning is
uncommon in the
It is simple industry and produces only
to implement
a minimal operating system overhead.
There is a high chance of inefficient use of
memory due to internal fragmentation.
The maximum number of active processes
that can be catered is fixed.
MEMORY
PARTITIONING
TECHNIQUES
Dynamic Partitioning
The partitions are created dynamically, wherein each
process is loaded into a partition of exactly the same
size as the process
This technique has no internal
fragmentation, which results in a more
efficient use
Inefficient ofof
use the main
the memory.
processor can transpire
due to the need for memory compression to
counter external fragmentation.
MEMORY
PARTITIONING
TECHNIQUES
Dynamic Partitioning
Below are the three (3) possible placement algorithms
that can be considered in implementing dynamic
partitioning:
Best-fit – This chooses the block that is
closest to the requested size.
First-fit – This scans the memory from the
beginning and chooses the first available
block that is large enough to cater to the
process.
Next-fit – This scans the memory from the
location of the last placement and chooses
the next available block that is large enough
to cater to the process.
MEMORY
PARTITIONING
TECHNIQUES
Simple Paging
The memory is divided into a number of equally
sized frames, while each process is divided into a
number of equally sized pages of the same length
as the frames. Then, a process is loaded by adding
all of its pages into the available frames
It plays an important role in implementing
virtual memory.
This technique reduces external
fragmentation.
This technique may cause a small amount of
internal fragmentation
MEMORY
PARTITIONING
TECHNIQUES
Simple Segmentation
Each process is divided into a number of
segments, wherein a process is loaded by adding
all of its segments into dynamic partitions.

There is no internal fragmentation in using


this technique, resulting to an improved
memory utilization and reduced overhead
compared to dynamic partitioning.
External fragmentation is a drawback of this
technique
VIRTUAL MEMORY

Virtual memory
Virtual memory is an abstraction of the main
memory, providing processes and the kernel with
their own, almost infinite, private view of the main
memory. Virtual memory is made possible through
the support from both the processor and operating
system. Belowmultitasking,
It supports are some characteristics of a virtual
allowing processes and the
memory
kernel: to operate on their own private address
space without worrying about contention.
It supports oversubscription of the main memory,
allowing the operating system to transparently map
virtual memory between the main and the
secondary memory,
It is not a real as and
memory needed.
most operating systems
map virtual memory to real memory only on
demand (when the memory is first populated or
VIRTUAL MEMORY

Virtual
Memory
Paging
This partitioning method is
similar to simple paging, but
does not necessarily load all
of the pages of the process.
This has no external
fragmentation and
encompass large virtual
address space, that may lead
to a higher degree of
multiprogramming.
VIRTUAL MEMORY

Virtual
Memory
Segmentatio
This partitioning method is
similar to simple
n
segmentation, but does not
necessarily load all the
segments of a process. This
has no internal fragmentation
and encompass a large virtual
address space, that may also
lead to a higher degree of
multiprogramming.
THANK
YOU

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy