Nitpick: it isn't actually "memorizing" and "forgetting" so much as it is pre-casting spells so you can release them quickly in combat; think of it less like "I suddenly don't know how to cast fireball anymore..." and more like carrying around a pistol with 3 bullets, a grenade launcher with 2 grenades, and a rocket launcher with 1 rocket--you know how to fire all of them, but you can't fire the rocket launcher twice until you get some more ammo.
This is made more clear (and more flavorful) in the original Dying Earth series, where the setting is post-apocalyptic, spells are complicated almost-intelligent constructs that want to be cast, anyone with the willpower to control them can prepare spells, and someone who can hold 6 spells in their head at one time is a very impressive spellcaster.