What is the basic function of paging?

ianblue

Solid State Member
Messages
9
Location
INDIA
Hello webmasters

In window operating system there are many functions all of have a particular work and related to each other.But I dont know about function of paging.Please share your ideas about function of paging in operating system.

Thanks...

 

root

Site Team
Staff member
Messages
8,181
Location
UK
you have memory.
lets say 8mb

you have an operating system that sits in 4mb
you open a program that takes up 2mb
you have a document open in memory that takes 1 mb
you open a program that used 2mb of memory,

now you can't you're using 7mb out of 8mb of memory, so you can't possibly open a program that will take 2mb of memory as there is no space in RAM for that program to run.

This is where paging, (or swapping if you use Linux comes in).

lets say that your first program is in the back ground, and you;re not looking at the document.

rather than keeping the data for these programs in memory, (fast RAM chips) since you're not really using this memory, why not empty out some of the memory, but since you will use it eventually, you can't just erase it, so you write if to disk.

you swap memory for disk,
or you write pages of memory, to a page file.

now your active memory contains 4mb for OS.
you have 4mb free and can open the new program that you want to run.

the penalty of paging is that it takes longer for the information to be read from mechanical disk than it does to be read from RAM, so when that data is needed for those programs you have to pull data from disk.

the reason it's called a page file is because data in memory is arranged in blocks called pages. these blocks of memory are sent to a file called the page file because it holds Pages from RAM.
 
Top