what is purpose of Swap parition | Comparision Between Buffer And Cache

Paging + swapping is Memory Management System.
What is Paging and swapping refer the Below table.
Virtual Memory(swap Memory/Partition):
1) Is created by the OS.
2) Portion of hard disk is used to store the page files.
3) When the RAM is not enough. In that time Virtual Memory will be used.
4) Virtual Memory is Memory Management developed by multitasking kernel.
swapping is an area on disk temporarily hold process memory image.
swap space keeps some physical memory free at all the times.
Swapping it is required fro the following reason 
1)Because the system requires more memory than physical memory.
2)significant number of pages used by an application using the startup process or bootup process. it will happen only the system startup process only for initialization. system can swap these pages and free memory for other application disk cacheusing #swapon -s
command we can find out where is swap partition is installed.
#swapon -s
Filename Type Size Used Priority
/dev/sda2 partition 20774904 52 -

To check the Virtual Memory Status

PAGING
SWAPPING
Some parts of process (block of equal size) are transferred between main memory and secondary storage (swapping-device).
Whole part of process (all segment belonging to the process) will be moved back and forth between main memory and secondary storage (swapping device).
Just move pages
Move the whole process.
Swapping is more suitable for heavier workloads.

Comparison between Cache and Buffer
Cache
Buffer
It is temporary storage area - where the frequent data accessed can be stored for rapid access.
So that average access time is shorter.
Special Memory used by CPU – decrease average time require to access memory.
Region of memory used for temporary purpose while it being moved from one place to another place.
In Terms Of Other Words:  Caching process of storing data in separate place (called cache)- access faster when it is require in the future. ( Increasing the performance , reduce the time taken from the main memory)
Holding the data in the region of memory until the data is transferred from one place to another place.
1)cache memory is quickly accessed by the processor.
When we write data
First store in buffer - > then write into file.
Cache HIT : Data present in cache
Ex: Printer, spooler, online video streaming.
Cache Miss: Data is not present in Cache, data fetch from original location.
EX : Browser Web Cache,

Comparison between Cache and Cookie
Cache
Cookie
Temporary Storage
Information.

Comparison between L1 Cache and L2 Cache
L1 Cache
L2 Cache
Is Primary Cache (or) Level 1 cache
Secondary Cache (or) Level 2 Cache
L2 is accessed only if requested data is not found in L1.
SRAM(Static RAM) is used to Implement L1
DRAM(Dynamic RAM) is used to Implement L2.
L1 does not need refreshing
L2 need refreshing.
Useful Link

Related post