Computer memory can be divided into internal and external memory. Internal memory includes cache and main memory, while external memory includes magnetic disks and optical disks. Memory types include RAM, ROM, SRAM, DRAM, PROM, EPROM, and EEPROM. RAM is volatile and used for main memory, while ROM is non-volatile and used to store permanent instructions. Cache memory is very fast memory between the CPU and main memory used to store frequently accessed data and instructions from main memory. Virtual memory allows programs to exceed physical memory size by storing unused portions on external memory.