Computer memory is needed to store data and programs and retrieve them when needed. There are two main types of computer memory: primary and secondary. Primary memory, also called RAM, is used to store data currently being processed and is volatile, meaning it only retains data while powered. Secondary memory, like hard disks, is used for long-term non-volatile storage and includes various devices such as hard disks, solid state drives, USB drives, and optical disks. Memory is measured in bits, bytes, kilobytes, megabytes, and other units with different types of RAM and storage serving different computing needs.