In the recent post I have been trying to explain about the difference between “Suspend” and “Hibernate” options in Ubuntu. For which one should know about the difference between Volatile and Non Volatile Memory.
Volatile Memory :
A device which holds the data as long as it has power supply connected to it and cannot hold the memory when there is no power supply connected to it is called Volatile Memory. The best example for this can be Random Access Memory ( RAM ), which will hold memory only as long as it is connected to power source and everything in it will be cleared if it gets disconnected from power source. Volatile memory is also called as temporary memory as it will hold memory temporarily.
Non Volatile Memory :
A device which can hold data in it even if it is not connected to any power source is called Non Volatile Memory. The typical examples for Non Volatile Memory are your Hard drives and flash drives. Even if you turn off your PC the data in your hard drive or flash drive stays intact.
Typical Usage Scenarios of Volatile and Non Volatile Memory
Random Access Memory ( RAM ) is a typical example of Volatile Memory. The data in it will be cleared as soon as you shut down your PC and that is the reason why it will take some time to load operating system after you start your PC during which applications will be loaded onto RAM. The advantage of RAM is that, it can be directly accessed by CPU and can access the data in it randomly everywhere instead of sequential access in magnetic tapes and the time it will take to access the data in RAM is faster than Hard drives hence the data related to the programs that you are using will be stored on to RAM.
Hard Drive is a typical example of Non Volatile Memory. It will take some time to access the data in a hard drive and it also will take some time to write data into it but can be retrieved back even if the power supply to it is interrupted. Hibernation is one of the good example of storing the memory that is there in RAM to Hard drive. If you remember in previous versions of windows we used to enable the hibernation manually and it used to say that it uses additional 2 GB of memory in Hard drive. What happens during hibernation is that all the data that is there on the RAM will be written over to Hard drive thereby storing the system state and system will be turned off. Whenever you turn on the PC again, the data in hard drive will be retrieved back to restore the system state. In linux typically this hard drive partition is SWAP. With the recent trends of making system to boot faster is using cold shutdown than proper shut down where the necessary programs that needed to start OS will be stored on to Hard drive and retrieved back after system start up through which boot time is reduced.
Hope you found what you were looking for, Thanks for reading.