You can replace memory in the 27-inch iMac by following the instructions in this section.
Important: The memory in the 24-inch iMac is not user-replaceable. The memory in the 21.5-inch iMac is not user-replaceable and can only be upgraded by an Apple authorized service provider. The 21.5-inch iMac can have a maximum of 32 GB (gigabytes) of memory installed. Do not attempt to open your 21.5-inch iMac to replace or upgrade its memory.
WARNING: Apple recommends that you have an Apple-certified technician install memory. Go to > Shut Down.
Disconnect all cables and the power cord from your iMac.
Place a soft, clean towel or cloth on your work surface. Hold the sides of your iMac and lay it down so that the screen rests on the surface and the bottom faces you.
Open the memory compartment door by pressing the small gray button located just above the AC power port.
With the notch on the bottom and toward the right side, replace or install a memory module by inserting it into the slot. Press firmly and evenly until you feel a slight click.
Replace the memory compartment door, then press it firmly.
Hold your iMac by its sides and return it to a standing position. Reconnect the cables and power cord.
Press the power button on the back of your iMac to turn it on.
Note: Your iMac performs a memory initialization procedure when you first turn it on after upgrading memory or rearranging DIMMs. This process can take 30 seconds or more, and the display of your iMac remains dark until it’s finished. Make sure to let the memory initialization complete.