You are on page 1of 14

ADVANCED TECHNIQUES OF MEMORY ALLOCATION

IN
OPERATING SYSTEM
Prof. Dr. Yao Saikrishna kommineni
Shamili koduru
Akshay kumar mucha marry anjesh
Shyam sunder Rao Devarashetty
Harish Rayapati
Outline
what is an Memory Management?
Paging
Why Paging Is Used?
Advantages of Paging
Disadvantages of Paging
Swapping
Advantages of Swapping
Disadvantages of Swapping
Simulation Output

Memory Managaement
Memory management is the act of
managing computer memory. The
essential requirement of memory
management is to provide ways to
dynamically allocate portions
of memory to programs at their request,
and free it for reuse when no longer
needed.
The concept of a logical address space
that is bound to a separate physical
address space is central to proper
memory management.
Logical address generated by the
CPU; also referred to as virtual address.
Physical address address seen by
the memory unit.
The set of all logical address generated
by a program.
Paging
Paging is a memory management
technique in which the memory is
divided into fixed size pages. Paging
is used for faster access to data.
Paging is a method of writing data to,
and reading it from, secondary
storage for use in primary storage,
also known as main memory. Paging
plays a role in memory management
for a computer's OS (operating
system).
When paging is used, a frame does
not have to comprise a single
physically contiguous region in
secondary storage.

Demand Paging
Advantages Of Paging
Address translation: each task has the
same virtual address
Address translation: turns fragmented
physical addresses into contiguous
virtual addresses
Memory protection (buggy or malicious
tasks can't harm each other or the
kernel)
Shared memory between tasks (a fast
type of IPC, also conserves memory
when used for DLLs)
Demand loading (prevents big load on
CPU when a task first starts running,
conserves memory)
Memory mapped files

Swapping Advantages
Swapping is the one of the efficient
regular and authentic approach of
memory management. It is the
process of swapping of higher priority
process on the lower priority process.
Advantages of swapping are as
follows :-
1. higher degree of multiprogramming.
2. dynamic relocation.
3. greater memory utilization.
4. priority based scheduling.
5. less wastage of CPU time.
6. higher performance.






Disadvantages Of Paging
The disadvantages of paging are extra
resource consumption, memory
overhead for storing page tables. The
worst cases are when page table may
take up a significant portion of virtual
memory. Solution is to page the page
table or go to a more complicated data
structure for translations. Other
disadvantage is translation overhead.
Swapping
Swapping is a mechanism in which a
process can be swapped temporarily
out of main memory to a backing
store, and then brought back into
memory for continued execution.
Backing store is a usually a hard disk
drive or any other secondary storage
which fast in access and large enough
to accommodate copies of all memory
images for all users. It must be
capable of providing direct access to
these memory images.

Swapping
Advantages of Swapping
Allocating memory is easy and
cheap
Any free page is ok, OS can take
first one out of list it keeps
Eliminates external fragmentation
Pages are mapped appropriately
anyway
Allows demand paging and
prepaging
More efficient swapping
No need for considerations about
fragmentation
Just swap out page least likely to
be used

Disadvantages of Swapping
Longer memory access times (page
table lookup)
Memory requirements (one entry
per VM page)
Improve using Multilevel page
tables and variable page sizes
(super-pages)
Guarded page tables
Page Table Length Register (PTLR)
to limit virtual memory size
Internal fragmentation

Output
MEMORY MANAGEMENT USING PAGING

Enter the Size of Physical memory: 16
Enter the size of Logical memory: 8
Enter the partition size: 4
The physical memory is divided into 4 no.of frames
The Logical memory is divided into 2 no.of pages
Enter the Frame number where page 0 must be placed: 5
Enter the Frame number where page 1 must be placed: 6
PAGE TABLE
PageAddress FrameNo. PresenceBit
0 5 1
1 6 1
FRAME TABLE
FrameAddress PageNo
0 32555
1 32555
2 32555
3 32555

Process to create the Physical Address
Enter the Base Address: 1000
Enter the Logical Address: 3
The Physical Address where the instruction present: 1023

You might also like