Relationship between cognitive load and self-indulgent behavior in simple task completion
Gailliot et al (2007), didn't do it with a memorization task, but with a variety of other tasks requiring self-control:


  The present work suggests that self-control relies on glucose as a limited energy source. Laboratory tests of self-control (i.e., the Stroop task, thought suppression, emotion regulation, attention control) and of social behaviors (i.e., helping behavior, coping with thoughts of death, stifling prejudice during an interracial interaction) showed that (a) acts of self-control reduced blood glucose levels, (b) low levels of blood glucose after an initial self-control task predicted poor performance on a subsequent self-control task, and (c) initial acts of self-control impaired performance on subsequent self-control tasks, but consuming a glucose drink eliminated these impairments. Self-control requires a certain amount of glucose to operate unimpaired. A single act of self-control causes glucose to drop below optimal levels, thereby impairing subsequent attempts at self-control.



Gailliot, Matthew T., et al. "Self-control relies on glucose as a limited energy source: Willpower is more than a metaphor." Journal of personality and social psychology 92.2 (2007): 325. PDF