Friday, September 12, 2008

Memories

For me it was when I was finishing a program for one of my Computer Science courses in the last throws of my college tenure. My young son was playing nearby as I clicked away trying to solve a particularly intractable algorithm. I was so wrapped up in my work that I neglected to save my program during an hour's worth of toil. Well, the power button on the surge suppressor that my PC was plugged into was too interesting to resist for my 18 month old son. With a 'click' and the drowning of the fan's whine my homework vanished. I couldn't very well blame my son....


Many of us can retell similar horror stories of data loss. As it turns out the computer can't actually change anything on the Hard Disk Drive. I know that sounds preposterous, but its true. Sure, it can read a file from the disk or write a file to the disk, but to actually change the file in between those two steps it needs RAM. RAM stands for Random Access Memory. RAM is a scratch-pad memory for your computer, it is the "Here and Now" space your computer uses. The file on the disk is just a magnetic mosaic until the computer reads it into RAM where it can flip the bits and change the bytes quickly and easily. Only when our application is instructed to "Save" (which may happen auto-magically in the case of auto-save) does our magnus opus make it to the relative safety of the hard disk drive where power failure cannot harm it! So how much RAM does a computer need anyway. That is a very subjective question. In the eons past of computer history, they got away with a little as a couple of thousand bytes. Today you need at least a couple billion bytes. We do a lot more media with our computers today so the demand for RAM is higher. Think about this, you have an 8 megapixel digital camera. It takes 3 bytes for each pixes and htere are around 8 million pixels per image. And you just loaded 300 pictures. "Wait!", you say, "Thats over 7 billion bytes! My computer only has 2GB (2 billion bytes) installed?!" OK, maybe you don't say that exactly, but you get the idea. When your computer runs out of RAM, it starts storing its scratch pad data on the hard drive, not as files this time, but as virtual memory. Virtual memory is one big file thats a mish-mash of what 'should' be in memory, and its much slower than RAM. So how much memory do you need. Well I wouldn't get less than 2GB if I were buying a new computer, but you may have better results with more when dealing with a lot of media.