Many pianists often have to face the problem of memory, and above all the fear of suffering from “memory blanks” while performing in public. Very frequently, though, the problem is not linked to the actual memorization of the piece, but to its rendition under critical conditions, that is front of an audience or in particularly stressful contexts (competitions, auditions, exams), where the pianist tends to react differently. So, rather than problems of memory, it would be more correct to say “problems of interference with the memory”, in the sense that it is precisely the interference generated by nervous (and often muscular) tension triggered by the fear of facing a particularly stressful situation that may compromise the performance.
There are many remedies to reduce such risks, and the first, of course, is to convince yourself that there is absolutely no reason to consider a public performance as something prone to risk. It is also very important to keep the muscles relaxed and to be constantly aware of which muscles are being used: often, in public, we tend to tighten our muscles and tendons, which leads to a change in our disposition at the piano, and, consequently, a risk of compromising what is stored in our memory, which also relies on bodily references and touch.
In my own personal experience, however, I have noted that the pianists who have the greatest memory problems are those that don't have a clear conception of the structure of the piece they are playing. In fact, every piece of music presents various types of “crossroads”, that is to say bifurcations in the discourse, at which, if you are not careful, you risk “taking the wrong turning”. In such a case, you might go back several pages, or, on the contrary, find yourself suddenly and prematurely at the end of the piece. There is a simple remedy to reduce the risk of this happening: to have numerous “signposts” while you are playing, in other words you should always know where you are, having a clear “map” of the composition in your head and of the route you must follow. In particular, we should always be aware of where the crossroads are, and, while we are studying, accustom our mind to anticipating them in good time, just like a driver would do who knows which way to go. In this way, the risk of “missing a junction” becomes much lower, and even if it should happen, we would be in time to get back onto the main road, without losing our way.