COMPUTER  MEMORY  EXPLAINED



Memory is one of the core hardware components for the computer. It is the component that temporarily stores information (such as Numbers, Characters, Settings, Instructions, Files and so on) once a computer has started. The information is temporary because when a computer is switched off or restarted the information is deleted from memory. When a program has finished with the information, the memory it was using is released (not deleted) so other programs can then use that memory.


Fig 1.0  An old SDRAM Memory Stick for the computer - Size: 32MB (Megabytes) only. Speed: 100Mhz only.

Memory itself is a microchip (Fig 1.0) that can temporarily store Bytes. The more bytes the memory has the more information it can temporarily store. A byte is just a number with a value between 0 and 255. It's an application's job to turn each byte into something a human and/or another application can interpret. For example. If the memory is storing 4 Bytes with the values 74, 79, 72 and 78 it would mean nothing to you. However. To Microsoft Word 2011 the byte value 74 means J. The byte value 79 means O. The byte value 72 means H and the byte value 78 means N. So even though the memory is storing byte values that mean nothing to you, Microsoft Word 2011 has no trouble interpreting (reading) those same byte values as JOHN.

The same applies to other applications that interpret (read) the byte values. For example. A Photo application might interpret 74 as colour Red, 79 as colour Yellow, 72 as colour Blue and 78 as colour Green. Whereas a Language program might interpret (read) 74 as English, 79 as Spanish, 72 as French and 78 as Italian. It depends on the application. Either way, the memory will always see 74, 79, 72 and 78. Here is a diagram of the memory with the 4 Bytes interpreted.

 
Fig 1.0  Byte values inside the Memory
 
Fig 1.1  Byte values as interpreted by Microsoft Word 2011

The logic behind interpreting byte values is like so: If the byte value is 74 display J (Microsoft Word 2011). If the byte value is 74 use English (Language program). If the byte value is 74 use colour Red (Photo application). And so on. In other words, the byte will always have its value of 74 but it can be interpreted differently depending on the application doing the interpreting. Applications that save settings (preferences) files use interpretation a lot to cut down on the number of bytes used. For example. If a photo application had to interpret RED, YELLOW and BLUE with characters it would use 13 Bytes (R E D Y E L L O W B L U E). Whereas using the logic of byte values to represent RED, YELLOW and GREEN it would only use 3 Bytes (79, 74 and 72).

Although the above concentrated on applications interpreting byte values that were already stored inside memory, the reverse is just as true. When you type the word JOHN into a Microsoft Word 2011 document for example its stores (puts) the byte values 74, 79, 72 and 78 inside memory. The same with a photo application. Instead of storing the characters R E D (byte values 82, 69 and 68) it might store the byte value 74 (which represents RED in the above example) so that it is uses 1 Byte, instead of 3, every time you use the red ink.

Basically, memory is just full of numbers that are interpreted by applications to mean Instructions, Settings (Preferences), Characters, Words, Sentences, Numbers, Symbols and so on.

ENOUGH  MEMORY

When an application opens it first allocates some memory for its own needs. For example. If you open a 1000 bytes essay file with Microsoft Word 2011, from a floppy disk, and edit it (i.e. you change the word JOHN into PAUL) the changes are not made to the essay file on the floppy disk. They are made inside memory to avoid wear of the floppy disk. If you imagine every time you edited an essay character (byte value) the whole essay file had to be re-saved onto floppy disk you would soon end up with a damaged floppy disk. Just changing JOHN into PAUL would mean four re-saves. Memory is purposely made for the constant editing of byte values.


When Microsoft Word 2011 opens an essay file from floppy disk for example it first allocates (reserves) 1000 bytes of file memory, so it can store an exact copy of the essay file inside that memory - The original essay file on the floppy disk is left intact. The next thing Microsoft Word 2011 does is allocate some memory for its editing needs. So if you make a copy of the word JOHN, because you want to add (paste) it somewhere else in the essay, behind the scenes Microsoft Word 2011 makes a copy of the word JOHN by storing the word JOHN inside the edit memory. So you now have 1000 bytes full of essay characters inside the file memory and 4 bytes used inside the edit memory for the J O H N characters. However, because you might want to copy a paragraph, an whole essay page or even the whole essay Microsoft Word 2011 has to make sure it has allocated enough edit memory for these situations.

The same applies to the file memory - It might not be allocated just 1000 bytes for the essay characters, but perhaps 3000 bytes just in case you need to add more to the essay (i.e. you start copying bits out of an History/Research file into the essay or you just type more characters into the essay). So the essay might need 5000 bytes in total allocated for it. Once you have finished editing the essay, which is in file memory at this point, you then tell Microsoft Word 2011 to save the file memory back onto the floppy disk as an essay file.

A collection of bytes is known as Data. Microsoft Word 2011 sees a file, and memory, as a block of data only. This means when it opens a file all it's doing is copying a block of data (the file's bytes) from one place (i.e. a Floppy Disk) to another (i.e. into File Memory). The same applies when saving a file - It sees the bytes that make up the essay (i.e. "An essay about....") as a block of data that it can save from file memory onto a floppy disk. And that is how you should see files and memory - as blocks of data. Once the essay (file memory) has been saved onto the floppy disk, as an essay file, the file memory and edit memory are then released for other applications to use.

The above is okay when everything is running smoothly, but problems arise when an application tries to allocate memory that is not available. For example. If you try to open too many applications or files at once they might crash (Freeze/Stop) OS X (Mountain Lion or Mavericks). This would be due to the applications either not having enough memory to open themselves (i.e. show their own windows) or not enough memory for their additional needs, such as editing files. If there are only 10,000 bytes of memory remaining and two newly opened applications are waiting for 50,000 bytes of memory each they will be put in a waiting queue. Waiting forever. Or at least until another application closes and releases its memory, but it might only be releasing 4000 bytes of memory. In which case one of the waiting applications could use the 4000 bytes now available and then wait for the other 46,000 bytes to become available.

On the other hand, the applications might get sick of waiting and decide to close. Either way it's a slow and messy process. This is why you should get to know the limits of your computer first before opening too many applications at once. Another scenario is memory corruption. Basically this is when an application misinterprets some byte values. For example. If a language program is supposed to read 74, in a settings (preferences) file, as English but sees (reads) 77 instead. It would probably show text in a different language - Not much harm as you could probably change the language setting (preference) back to English once the language application had opened and fully completed. However. Imagine if an application interprets a byte value of 100 to mean you have paid/registered to use that application and a byte value of 101 to mean you are just trying out that application for 30 days.


You might of paid £30 for an application that is saying you have not paid, but you are just trying it out. Incidently. This is one way hackers hack legal software...they change the application's data (byte values) so it thinks the user has paid for it. Apart from hacked bytes data is normally corrupted because the files (software/applications) came from a bad/scratched floppy disk or CD - The files can still be read as data (byte values), but as incorrect data. Unfortunately, an application will not test every byte value inside a file simply because it would take too long, especially if it was a large file.

BYTE  SIZES

The reason for explaining memory to you is so that you get some idea of how Data is stored and how memory is allocated. In the above examples I mentioned bytes in terms of thousands only (i.e. 4,000 and 50,000) so you could understand the examples quite easily. However, the reality is that applications and files have become bigger and bigger over the years, to the point where you no longer say a file is just a few thousand bytes long. Now a file can be millions of bytes long. The same applies to the computer. Years ago the memory inside it might have been a maximum of 32KB (32,768 bytes), whereas these days it must have a minimum of 1GB (1,073,741,824 bytes) inside it. KB (KiloByte), MB (MegaByte), GB (GigaByte) and TB (TeraByte) are Byte terminology (jargon), as below:

Byte
Bytes
1 KiloByte
2 KiloBytes
1 MegaByte
2 MegaBytes
1 GigaByte
2 GigaBytes
1 TeraByte
2 TeraBytes
1 Byte
2 Bytes or more
1,024 Bytes
2,048 Bytes
1,024,000 Bytes
2,048,000 Bytes
1,024,000,000 Bytes
2,048,000,000 Bytes
1,024,000,000,000 Bytes
2,048,000,000,000 Bytes


KiloByte(s) is abbreviated to KB
To work out KiloBytes just devide or multiply Bytes by 1,024
MegaByte(s) is abbreviated to MB
To work out MegaBytes just devide or multiply Bytes by 1,024,000
GigaByte(s) is abbreviated to GB
To work out GigaBytes just devide or multiply Bytes by 1,024,000,000
TeraByte(s) is abbreviated to TB
To work out TeraBytes just devide or multiply Bytes by 1,024,000,000,000

READ  /  WRITE

When data is being read (i.e. from a floppy disk) it is known as Reading the data (because it is being looked at) and when data has been read it is known as Read (because it has been looked at).

When data is being saved it is known as Writing the data (because it is being written onto something, such as: a floppy disk) and when data has been saved it is known as Written (because it has been written onto something, such as: a floppy disk).

ROM  /  RAM

Memory is known by two types. ROM (Read Only Memory) which means hardware and software can only read the byte values stored inside rom memory and RAM (Read Access Memory) which means hardware and software can not only read the byte values stored inside ram memory but they can also, temporarily, change the byte values stored inside ram memory.

ROM memory is a microchip on a motherboard (green microchip board), such as a Modem motherboard, that contains the instructions (byte values) needed to make the hardware (Modem) work. This is why ROM memory cannot have its byte values changed. The instructions (byte values) are preprogrammed onto the microchip, so that when you first switch on the computer the instructions (byte values) are always the same.

RAM memory is a microchip that is permanently fitted onto a Card (small motherboard), such as a Graphics Card or Memory Card, or a single removable microchip that you attach to the main motherboard. The main motherboard is the big green microchip board inside the computer (base unit). RAM memory can have its byte values temporarily changed, and read, so that you can change Graphics settings (Graphics Card) or store data (Memory Card) for example.

Even though RAM memory is cleared when you switch off or restart the computer, because it is meant as a temporary storage place only, the data inside the memory is normally saved by an application (as a file) beforehand. For example. If you change the Modem (hardware) settings using a modem application it will save your changes as a settings file on the hard drive before the computer is switched off or restarted. When the computer is switched on again the modem uses its default (normal, preprogrammed) settings before looking at, and using, the settings from the saved settings file. The modem uses its default settings first for two reasons. One is so that it knows it is setup correctly (by using its normal, manufacturer's, preprogrammed settings) and two is in case the settings file is corrupt, damaged or missing. If it reads a settings file incorrectly (i.e. because it is corrupt) you may get problems with the modem or it may revert back to its default settings.

VIRTUAL  MEMORY

When OS X (Mountain Lion or Mavericks) finally runs out memory, or when it cannot fit something really big inside memory as one piece, it starts using a thing called Virtual Memory, which is Hard Drive space that is used as memory. For example. Imagine you have just typed out a 10,000 line document using Microsoft Word 2011 and then you run out memory. Instead of OS X (Mountain Lion or Mavericks) telling you "You cannot type anything else - No more Memory available" it will just let you carry on typing as normal. This is because the rest of your typing will be stored on the hard drive as a file, which you have no access to. As far as you are concerned you are just typing a document and so do not have to worry about virtual memory. However, you should be aware that over time this wears out the hard drive. So always make sure you have plenty of memory.

GRAPHICS  MEMORY

Graphics Memory is a microchip on the motherboard of a Graphics Card. It is the memory that stores your Imagery (Desktop Picture, Game Scenes, Photographs, Icons, Text and so on). Its main job is to store Imagery inside its graphics memory and then display that imagery, on the monitor screen, when an application asks it to. For example. If you are editing a photograph your photo editor application would of allocated some of the graphics memory as file memory (for the original photograph) and some of the graphics memory as edit memory (for editing purposes) - In the same way the file memory and edit memory was allocated in the Microsoft Word 2011 explanation above.


The graphics card will not only display the photograph (file memory) on the monitor screen, but it will also update (refresh) the monitor screen instantly every time you edit the photograph. In the same way that Microsoft Word 2011 updates instantly any changes you make to a document. Graphics memory is also in charge of storing other imagery. For example. If you have one game open, a photo application open and the internet open it is graphics memory storing the imagery of those three applications. The more applications open that use graphics memory the more tasks (jobs) you are giving the graphics card. Meaning, if you give it too much to do and/or it runs out of graphics memory it will not be able to update the monitor screen quick enough, which means editing and game playing for example will not be instant.

The monitor screen will update (draw the imagery) so slowly that it would not be worth editing a photograph or playing a game. A normal sign of this is when the monitor screen is updated (drawn) line by line as opposed to instantly. So get a good Graphics Card with plenty of Graphics Memory because the one built into the computer might not be good enough for your needs.

MEMORY  SPECIFICATIONS

Memory Size is measured in multiples of 8 MegaBytes (i.e. 256MB, 512MB and 1024MB), which means you could never have 274MB or 519MB for example, and Memory Speed is measured in MegaHertz (Mhz).

Computers made before the year 2000 normally use memory known as SDRAM, which is now very difficult to find because it is no longer manufactured. A SDRAM memory chip can either be 100Mhz, 133Mhz or 166Mhz and is named after its speed: PC100, PC133 or PC166.

Computers made between the years 2000 to 2005 (approximately) normally use memory known as DDR, which is still being sold at the present time. A DDR memory chip normally comes with one of the following specifications: PC1600 (200 Mhz), PC2100 (266 Mhz), PC2400 (300 Mhz), PC2700 (333 Mhz), PC3200 (400 Mhz) or PC4000 (500 Mhz).

Computers made between the years 2005 to 2008 (approximately) normally use memory known as DDR 2. A DDR 2 memory chip normally comes with one of the following specifications: PC2-3200 (400 Mhz), PC2-4200 (533 Mhz), PC2-5300 (667 Mhz) or PC2-6400 (800 Mhz).

At the time of writing (2014) the standard memory type is now DDR 3. It comes in specifications such as PC3-8500 (1066 Mhz), PC3-10600 (1333 Mhz) and PC3-12800 (1600 Mhz). The 13" MacBook Pro (Mid 2012 / £999 model) for example uses DDR 3 Memory - PC3-12800 (1600 Mhz). As you can see, memory capacity has got bigger and faster over the years. And cheaper too!



Fig 1.3  The newer DDR3 Memory Stick for laptops - Size: 4GB (GigaBytes). Speed: 1600Mhz.

Note. Because newer/better memory is manufactured every so often, the memory specifications above are only here to give you an idea of the kind of memory specifications available. I have not mentioned every single memory specification out there in other words. The time overlaps above (i.e. in 2005) mean that newer memory was created in the same year.

MEMORY  SLOTS  /  MEMORY STICKS

If you are wondering how much memory your apple mac computer should have inside it (installed) in order to function properly and reasonably well, it should generally be double the amount of whatever memory your computer came with. So if it came with 4GB installed then try and upgrade it to 8GB, if it can be upgraded to 8GB of course. Remember, applications are becoming bigger and more memory hungry these days and will continue to be in the future.


Another thing to remember is that apple mac laptops for example only have 2 Memory Slots built-in to them. So if you have a MacBook Pro Laptop computer with 4GB of memory installed it usually means Apple have fitted a 2GB Memory Stick into each memory slot when ideally they should of fitted a 4GB memory stick into the first memory slot and then left the second memory slot empty. That way it would work out cheaper for you just to buy an extra 4GB memory stick to fit inside the second, empty, memory slot. As it stands with this scenario, it means you would have to take out both 2GB memory sticks in order to replace them with two 4GB memory sticks; which is costly and means you end up with two perfectly good but redundant 2GB memory sticks.

If you are going to upgrade your computer's memory you are better off shopping online for the memory sticks simply because Apple charge a rediculous, "rip-off", price that in my eyes can never be justified. As an example; Two 4GB Memory Sticks for the MacBook Pro Laptop computer costs £160 from the Apple Store (2 x 4GB Memory Sticks) but only £32.39 from Crucial (2 x 4GB Memory Sticks). To find out what type of memory sticks are inside your apple mac computer, and therefore what type of memory sticks to buy and upgrade with, I recommend using Crucial's Mac System Scanner.