When I was a student, I was thinking so before the exam.
I heard that is possible by the Kokuzo-bosatsu (Akasagarbha) method. You need to sing the mantra “Namo Ākāśagarbhāya, Oṃ ali kalmali mauli svāhā” for 10,000 times a day and repeat that for a hundred days. By repeating this totally 1 million times, you will get unlimited memory.
Because it takes 7 seconds at one time, it takes about 19 hours to sing 10,000 times a day.
I tried it once, but of course I was frustrated on the first day.
If you are really passionate, you should try it.