Here’s the thing:
Fatigue is normal, but will get worse over time if you don’t address it.
First, recognize that you might be putting too much on yourself. If you studied / programmed 10 minutes a day, every day, you would achieve more than someone who studied 2 hard hours every weekend. So consider whether you’d be fine doing a half an hour or less on some days if you don’t have the energy.
Also as others have pointed out, memorizing everything isn’t that useful, practicing is. Build something fun!
Not the Death Star, this is from empire, this would be the inside of cloud city