Language:
كتاب العلم
3  
Knowledge
(42)
Chapter: (What is said regarding) the memorization of (religious) knowledge
(42)
باب حِفْظِ الْعِلْمِ
Sahih al-Bukhari 119

Narrated Abu Huraira:

I said to Allah's Messenger (ﷺ) "I hear many narrations (Hadiths) from you but I forget them." Allah's Apostle said, "Spread your Rida' (garment)." I did accordingly and then he moved his hands as if filling them with something (and emptied them in my Rida') and then said, "Take and wrap this sheet over your body." I did it and after that I never forgot any thing.

Narrated Ibrahim bin Al-Mundhir:

Ibn Abi Fudaik narrated the same as above (Hadith...119) but added that the Prophet (ﷺ) had moved his hands as if filling them with something and then he emptied them in the Rida' of Abu Huraira.

حَدَّثَنَا أَحْمَدُ بْنُ أَبِي بَكْرٍ أَبُو مُصْعَبٍ، قَالَ حَدَّثَنَا مُحَمَّدُ بْنُ إِبْرَاهِيمَ بْنِ دِينَارٍ، عَنِ ابْنِ أَبِي ذِئْبٍ، عَنْ سَعِيدٍ الْمَقْبُرِيِّ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قُلْتُ يَا رَسُولَ اللَّهِ، إِنِّي أَسْمَعُ مِنْكَ حَدِيثًا كَثِيرًا أَنْسَاهُ‏.‏ قَالَ ‏"‏ ابْسُطْ رِدَاءَكَ ‏"‏ فَبَسَطْتُهُ‏.‏ قَالَ فَغَرَفَ بِيَدَيْهِ ثُمَّ قَالَ ‏"‏ ضُمُّهُ ‏"‏ فَضَمَمْتُهُ فَمَا نَسِيتُ شَيْئًا بَعْدَهُ‏.

حَدَّثَنَا إِبْرَاهِيمُ بْنُ الْمُنْذِرِ قَالَ حَدَّثَنَا ابْنُ أَبِي فُدَيْكٍ بِهَذَا أَوْ قَالَ غَرَفَ بِيَدِهِ فِيهِ‏.‏

Reference : Sahih al-Bukhari 119
In-book reference : Book 3, Hadith 61
USC-MSA web (English) reference : Vol. 1, Book 3, Hadith 119
  (deprecated numbering scheme)