Are you just afraid of memory lapses or is this a real problem?
If you can play the piece a lot slower while keeping the memory, then you should have no problem. Still, memory plays trick on us at the stupidiest moments (I dont recall any of my last concerts not to have one), but you should always have references, such as in Bach's prelude and Fugue, I learn the start of each lines so if I mess up I can continue with no much problem. Whatever happens, do not stop the music.
Play SLOWLY from memory. Like, less than half of normal speed. Long as you have the patience, this should be the most reliable method.