After consulting your doctor, you might be able to tackle sleep deprivation by reciting Tasbeeh of Fatima Zahra (AS) with understanding every word of it (Allahu Akbar 43 times , Alhamdulillah 33 times then Subhanallah 33 times). By repeating this Tasbeeh, you might be able to tackle this problem.'
For better memory there are many solutions including : 1. Performing every Prayer on time and never postponing it. 2. Reciting Quran or listening to Quranic recitation as much as you can. 3. Trying to memorize Quranic verses as much as you can and trying to add more gradually.
4. Reciting this Du'a after Prayers : ALLAHUMMA EJ'AL LI FI QALBI NOORAN WA BASARAN WA FAHMAN WA ;ELMAN INNAKA 'ALA KULLI SHAY;IN QADEER. اللهم إجعل لي في قلبي نوراً وبصراً وفهماً وعلماً إنك على كل شيءٍ قدير.
Wassalam.