Explain how main memory and virtual memory can solve memory management issues.