1. Video Lecture and E-Content Created by
R.D.SIVAKUMAR,M.Sc.,M.Phil.,M.Tech.,
Assistant Professor of Computer Science &
Assistant Professor and Head, Department of M.Com.(CA),
Ayya Nadar Janaki Ammal College,
Sivakasi – 626 124.
Mobile: 099440-42243
e-mail : sivamsccsit@gmail.com website: www.rdsivakumar.blogspot.in
PAGING
2. Paging is one of the memory management schemes by which a computer can
store and retrieve data from secondary storage for use in main memory.
In the paging memory-management scheme, the operating system retrieves
data from secondary storage in same-size blocks called pages.
PAGING DEFINITION
3. The main advantage of paging over memory segmentation is that it allows the
physical address space of a process to be noncontiguous.
Before paging came into use, systems had to fit whole programs into storage
contiguously, which caused various storage and fragmentation problems.
ADVANTAGES
4. Demand Paging - When pure demand paging is used, page loading only
occurs at the time of the data request, and not before.
Anticipatory paging - This technique, sometimes called "swap prefetch",
preloads a process's non-resident pages that are likely to be referenced in the
near future.
Free page queue - The free page queue is a list of page frames that are
available for assignment after a page fault.
PAGE REPLACEMENT ALGORITHMS
5. Page stealing - Some operating systems periodically look for pages that
have not been recently referenced and add them to the Free page
queue, after paging them out if they have been modified.
Pre-cleaning - Unix operating systems periodically use sync to pre-
clean all dirty pages, that is, to save all modified pages to hard disk.
PAGE REPLACEMENT ALGORITHMS (Conti..)
6. Most programs reach a steady state in their demand for memory locality
both in terms of instructions fetched and data being accessed.
This steady state is usually much less than the total memory required by
the program.
This steady state is sometimes referred to as the working set: the set of
memory pages that are most frequently accessed.
THRASHING
7. In multi-programming or in multi user environment it is common
for many users to be executing the same program.
If individual copies of these programs were given to each user,
much of the primary storage would be wasted.
The solution is to share those pages that can be shared.
SHARING
8. In some older virtual memory operating systems, space in swap backing
store is reserved when programs allocate memory for runtime data.
OS vendors typically issue guidelines about how much swap space should be
allocated.
TUNING SWAP SPACE SIZE
9. Swapping can decrease system reliability by some amount. If swapped data
gets corrupted on the disk, the memory will also have incorrect contents after
the data has later been returned.
RELIABILITY
10. Address generated by CPU is divided into:
1. Page number (p) – used as an index into a page table which contains base
address of each page in physical memory.
2. Page offset (d) – combined with base address to define the physical memory
address that is sent to the memory unit.
ADDRESS GENERATED
13. Page-table base register (PTBR) points to the page table.
Page-table length register (PRLR) indicates size of the page table.
IMPLEMENTATION OF PAGE TABLE
14. Shared code
One copy of read-only (reentrant) code shared among processes (i.e., text
editors, compilers, window systems).
Shared code must appear in same location in the logical address space of
all processes.
Private code and data
Each process keeps a separate copy of the code and data.
The pages for the private code and data can appear anywhere in the logical
address space.
SHARED PAGE