Sunday 15 September 2013

Why Does RAM Have to be Volatile?

The Answer

 it’s due to physics.
Any non-volatile memory must store its bits in two states which have a large energy barrier between them, or else the smallest influence would change the bit. But when writing to that memory, we must actively overcome that energy barrier.
Designer have quite some freedom in setting those energy barriers. Set it low 0 . 1, and you get memory which can be rewritten a lot without generating a lot of heat: fast and volatile. Set the energy barrier high 0 | 1 and the bits will stay put almost forever, or until you expend serious energy.
DRAM uses small capacitors which leak. Bigger capacitors would leak less, be less volatile, but take longer to charge.
Flash uses electrons which are shot at high voltage into an isolator. The energy barrier is so high that you can’t get them out in a controlled way; the only way is to clean out an entire block of bits.
In other words, the only way to make the RAM as high speed as we need it for modern computer operations is to keep the resistance between state changes extremely low (and thus make the RAM volatile and susceptible to data erasure in the face of power loss).

RAM Is Cheap So Why Don’t We Run Everything From It?

The Answer

 http://cdn.howtogeek.com/wp-content/uploads/2013/09/img_5228b7713cdf6.jpg


There are a few reasons RAM is not used that way:
  1. Common desktop (DDR3) RAM is cheap, but not quite that cheap. Especially if you want to buy relatively large DIMMs.
  2. RAM loses its contents when powered off. Thus you would need to reload the content at boot time. Say you use a SSD sized RAMDISK of 100GB, that means about two minutes delay while 100GB are copied from the disk.
  3. RAM uses more power (say 2–3 Watt per DIMM, about the same as an idle SSD).
  4. To use so much RAM, your motherboard will need a lot of DIMM sockets and the traces to them. Usually this is limited to six or less. (More board space means more costs, thus higher prices.)
  5. Lastly, you will also need RAM to run your programs in, so you will need the normal RAM size to work in (e.g. 18GiB, and enough to store the data you expect to use).
Having said that: Yes, RAM disks do exist. Even as PCI board with DIMM sockets and as appliances for very high IOps. (Mostly used in corporate databases before SSD’s became an option). These things are not cheap though.