Imam Bukhari was able to glance at a page of hadeeth once and he would memorize it. 

Imam Shafi’ee had to cover the notes in the margins of the texts he read because if he did not, he would memorize them and it would conflict with what he was trying to memorize. 

Imam Ash-Shu'ba would cover his ears when he went through the market because he was afraid of memorizing the fruitless conversations which took place there. 

Imam Ahmad memorized one million hadith just as well as the layman memorizes Surah Ikhlaas. 

The question arises; how did these great scholars memorize so effortlessly? 

There is no doubt that these abilities to memorize are of the gifts and blessings given to them by Allah  But there are some secondary factors, which helped the scholars to achieve such a precise memory. 

One reason why scholars memorized so easily was that they respected the knowledge. To them, the knowledge of hadith was worth more than gold. They valued the knowledge in the light that it deserves. Because it was important to them, it became something that took priority in their brain. 

This is just as one would remember the name of a potential spouse after speaking to her only once, but keep forgetting the brother or sister you bumped into at the Masjid occasionally. Likewise, we see kids memorizing trivia facts about their favorite basketball and football players without even trying. But if you ask them about Abu Sa’eed al Khudri, they might be clueless. The problem is simple. We simply do not put enough importance or priority in our minds on the Deen. The respect for knowledge is one of the contributing factors in the ability to retain the knowledge, as the scholars practiced. 

Here in the west, people are taught to understand and not memorize. Understanding is very important, but a void exists in this culture with the memorization ability of the majority. Memorizing is a skill that improves with frequency. In other words, the more one attempts to memorize, the more efficient one will become in memorizing. 

One can liken memorizing to weightlifting. It might be very difficult for the person who never lifted weights before to work out. But for the person who has been doing it for several years consistently, he will find it very easy and even enjoyable. 

Memorizing is simply another skill that becomes better with practice. Consider the low percentage of the brain that people use (~12%), then we see everyone has great potential. Memorizing helps increase our memory and capacity, not vice versa. 

The lesson to draw from this point is to try to memorize everything you come across for the sake of becoming a better memorizer. Rather than mentally “marking it for deletion” an ayah or hadeeth because it’s available in a book, try memorizing for the sake of improving your memory. 

We might think that when a person ages, their memory goes down the drain. But why then do you see so many shayookh who are very elderly in age, but very sharp in their memory? The reason is simple. Old age is not the only factor to memory depletion, accumulation of sins affects this as well. The more sins you commit, the worse your memory becomes. Amazingly, Imam Shafi’i was not content with his memory. He complained to his teacher Wakia ibn Jarrah about this. 

“I complained to my teacher about my bad memory, and he told me to stay away from sins, for indeed the knowledge of Allah is light, and the light of Allah is not given to sinners.” 

We see here that there is a connection between ones memory and the sins that he/she commits. We all commit sins, but it is up to us to try our hardest to avoid all we can and to continue to repent to Allah . The Qur’an and the Sunnah does not mix at all with sins.They are repellents of one another. 

Another way to memorize is to have khushu' in prayer. This has been scientifically proven by non-muslims. In an article that Sheikh AbdulBary Yahya came across less than a year ago, it stated that "conscious editation" is the way to increase memorization ability. In Islamic terminology, “conscious meditation” is nothing other than khushu’ in Salah.

There is no denying that memorization is part of our deen. Every Muslim is required to recite from memory at least some portion of the Qur’an in their Salah. Notice also that the Prophet’s  hadeeth earlier specifically mentioned the face being enlightened of the ones who repeat exactly what he said. This implies memorization of the sayings of the Prophet 

A final point here related to memorizing is preserving the knowledge we seek. Sheikh Abdulbary’s advice is that people get in the habit of taking notes whenever we are seeking Islamic knowledge. Also, when they are studying the notes that they write down, they should put ourselves in the mindset that they will be teaching the knowledge to someone else the very next month. 

In that way, they will find themselves retaining the knowledge that they come across. Below is a summary of the ways to improve memory. 

Ways to Improve Memory: 

1. Developing Respect for the Knowledge 
2. Memorize Frequently 
3. Avoid Sins 
4. Khushu’ in Prayer

The Chain of Command 
Taught by Shaykh Abdul Bary Yahya

Help To Improve your memory 

Before you study for your next exam, you might want to use a few strategies to boost your memory of important information. There are a number of tried and tested techniques for improving memory. These strategies have been established within cognitive psychology literature and offer a number of great ways to improve memory, enhance recall and increase retention of information.
1. Focus your attention on the materials you are studying.
Attention is one of the major components of memory. In order for information to move from short-term memory into long-term memory, you need to actively attend to this information. Try to study in a place free of distractions such as television, music and other diversions.

2. Avoid cramming by establishing regular study sessions.
According to Bjork (2001), studying materials over a number of session’s gives you the time you need to adequately process the information. Research has shown that students who study regularly remember the material far better that those did all of their studying in one marathon session.

3. Structure and organize the information you are studying.
Researchers have found that information is organized in memory in related clusters. You can take advantage of this by structuring and organizing the materials you are studying. Try grouping similar concepts and terms together, or make an outline of your notes and textbook readings to help group related concepts.

4. Utilize mnemonic devices to remember information.
Mnemonic devices are a technique often used by students to aid in recall. A mnemonic is simply a way to remember information. For example, you might associate a term you need to remember with a common item that you are very familiar with. The best mnemonics are those that utilize positive imagery, humor or novelty. You might come up with a rhyme, song or joke to help remember a specific segment of information.

5. Elaborate and rehearse the information you are studying.
In order to recall information, you need to encode what you are studying into long-term memory. One of the most effective encoding techniques is known as elaborative rehearsal. An example of this technique would be to read the definition of a key term, study the definition of that term and then read a more detailed description of what that term means. After repeating this process a few times, your recall of the information will be far better.

6. Relate new information to things you already know.
When you are studying unfamiliar material, take the time to think about how this information relates to things that you already know. By establishing relationships between new ideas and previously existing memories, you can dramatically increase the likelihood of recalling the recently learned information.

7. Visualize concepts to improve memory and recall.
Many people benefit greatly from visualizing the information they study. Pay attention to the photographs, charts and other graphics in your textbooks. If you do not have visual cues to help, try creating your own. Draw charts or figures in the margins of your notes or use highlighters or pens in different colors to group related ideas in your written study materials.

8. Teach new concepts to another person.
Research suggests that reading materials out loud significantly improves memory of the material. Educators and psychologists have also discovered that having students actually teach new concepts to others enhances understanding and recall. You can use this approach in your own studies by teaching new concepts and information to a friend or study partner.

9. Pay extra attention to difficult information.
Have you ever noticed how it’s sometimes easier to remember information at the beginning or end of a chapter? Researchers have found that the position of information can play a role in recall, which is known as the serial position effect. While recalling middle information can be difficult, you can overcome this problem by spending extra time rehearsing this information or try restructuring the information so it will be easier to remember. When you come across an especially difficult concept, devote some extra time to memorizing the information.

10. Vary your study routine.
Another great way to increase your recall is to occasionally change your study routine. If you are accustomed to studying in one specific location, try moving to a different spot to study. If you study in the evening, try to spend a few minutes each morning reviewing the information you studied the previous night. By adding an element of novelty to your study sessions, you can increase the effectiveness of your efforts and significantly improve your long-term recall.