can anybody can tell me about swapping??

India
January 18, 2007 11:48am CST
i have operating syatem as my subject and i am a bit confused with the swapping concept and also about the virtual memeory, where it resides etc?? please help me out
1 person likes this
8 responses
• India
27 Jan 07
As I know about Swapping concept, its same for LINUX as well as WINDOWS, that is, Swap Partition or Virtual memory size would be double of yours Primary Memory size, that is, RAM size. For Example: For 128 MB RAM - Swap Partition Should be 256 MB. Its just helps processor to get maximum hits and has page file size constant. have a nice day. Bye
1 person likes this
• India
30 Jan 07
thanks for ur response
• India
18 Jan 07
a computer system has two typs of memory 1. primary memory RAM: which is fast but small in size 2. secondary memory which is bigger but slower to access all our programs are executed in RAM... for the programs which are bigger in size than Ram capacity are stored in the reserved area in the secondary memory called virtual memory..... program to be executed is divided into pages and only those pages which require current execution is loded in RAM.... if CPU requires any page which in not in RAM it takes the rquired page from virtual memory and the non required page is put back into virtual memory this is called swapping
1 person likes this
@raisushkr (1398)
• India
19 Jan 07
all the 4 persons r rite .their definition is rite. when i was studying i compared swapping to cache memorey and compared how they both worked their difference.that made it wasy to understand for me. just print out the diff between both may b u will understand too
• India
30 Jan 07
thanks for the response
@blueman (16509)
• India
24 Jan 07
virtual memory is nothing but the amount of hard disk space which the computer uses to assist the RAM, and swap files are same as virtual memories whether in linux or windows.
• India
30 Jan 07
thanks for the response
@hobohobo (678)
• Indonesia
19 Jan 07
1. Swapping is a useful technique that enables a computer to execute programs and manipulate data files larger than main memory. The operating system copies as much data as possible into main memory, and leaves the rest on the disk. When the operating system needs data from the disk, it exchanges a portion of data (called a page or segment ) in main memory with a portion of data on the disk. 2. Virtual memory is a fiture in the windows where part of your disk space used as a memory, it can improve your phisical memory, actually windows will set your virtual memory as they need, but you can change it as you like just try it, just for advise it really useful using virtual memory because can make your computer work faster
• India
19 Jan 07
thanx for ur response
• India
19 Jan 07
Swapping is a mechanism to handle virtual memory. Virtual memory uses two methods to free up RAM when needed. 1) Swapping. 2) Paging. Swapping. = An entire process, including code segment and data segments is expunged from the system memory. Paging. = Only single pages are swapped out. Of course, the simplest way to clear a space in RAM is to terminate some processes, but virtual memory is more subtle than that. The idea is to free RAM only temporarily, with the intention of copying the data back again later. All of this should happen in such a way that the user of the system do not realize that it is happening. Swapping and paging dump the system memory in special disk caches. Normally these disk areas are not part of the usual file system structure, since the overhead of maintaining a file system is inapropriate when only the system needs to use the disk. Instead, the system stores swap files in large contiguous blocks, sacrificing utilization of space for speed. Some systems also allow swapping to a special file in the normal filesystem, which has a reserved size. I m giving you some algo which are used while implementing swapping in OS. 1)FIFO - first in first out 2)LRU - least recently used if u want more information, please feel free to ask.
• India
19 Jan 07
thanx for ur response...... it really helped
• India
19 Jan 07
thanx for ur response.....
@indiranaik (1525)
• India
24 Jan 07
swapping means:moving entire process in and out of main memory. purpose of virtual memory is to enlarge the address space in the main memory
@amgupta (274)
• India
18 Jan 07
swapping is a memory management concept...say you have actual free RAM of only 1024 bytes and you are trying to run a program which is 1500 bytes long...now to run this program you will need to apply a concept known as paging along with swapping...in paging you divide your program in small chunks of equal size.. now your pu at a time can execute only a single instruction although it may require some process data also...now say we divide our program in 3 chunks of 500 bytes.. each chunk is known as a page..now you will load only one page in the memory instead of while program..and if while processing the page you require to access the instruction or memory in some other page..you will load the second page in the memory if any free space is available..however if no free space is available..you will select an existing page based on some algorithms and remove it from memory and save it on disc (in disk paging space on windows and swap space on unix)....and load your required page in its place...this loading out and loading in of a page is called swapping
• India
19 Jan 07
thanx for the response