what is virtual memory in OS?
When the cpu needs more memory than the RAM in a machine, it will use space on the hard drive as memory. Hard drives are significantly slower, usually considered 1000 times slower, than memory. The cpu will swap pages, usually 4096 bytes/page, of memory from RAM to and from disk. Unix refers to this as swapping, Microsoft calls it paging. Unix systems usually have a partition on the disk for swapping, the swap partition. If more space is needed, swap files can be created in the filesystem. Microsoft has a page file in the filesystem for paging. When swapping gets too intense, a condition known as thrashing can happen. The computer is so busy swapping/paging that it doesn't get any useful ( user ) work done. Generally, computers are set up with twice as much swap space as RAM.
Join our real-time social learning platform and learn together with your friends!