MS-DOS manages memory to ensure that all programs have access to the memory they need to run successfully. The system allocates memory for a program during loading, and the program can allocate additional memory as needed, or free any unneeded memory.