Computer memory can store information temporarily or permanently. There are two types of memory allocation: static allocation at compile time and dynamic allocation at runtime. Dynamic allocation uses functions like malloc(), calloc(), realloc(), and free() to allocate and free memory as needed during program execution. Malloc allocates a single block, calloc allocates multiple blocks and initializes to zero, realloc changes the size of an existing block, and free releases a block back to the system.