Memory refers to the physical devices used to store programs and data in a computer. Main memory is divided into RAM and ROM. RAM is read-write memory that uses transistors and capacitors to store each bit. There are two types of RAM: static RAM which does not need refreshing but is expensive, and dynamic RAM which needs refreshing but has higher density. ROM is read-only and stores permanent instructions. There are also programmable ROMs like PROM, EPROM, and EEPROM that can be programmed and erased in different ways. Caches and secondary storage supplement main memory and improve performance. Common secondary storage devices include magnetic disks, tapes and optical discs.