Malnutrition is bad, and has a wide array of health effects. Trying to understand the way that the brain behaves after long term caloric deficiency, scientists conducted a study on fruit flies. The study was reported over at Ars Technica, but the link to the Science article abstract is here.
The purpose of the study was to look at what happens in the brain as resources become constrained. What they found was that the flies stopped creating most long term memories. They tested this by training the flies to associate a certain smell with an electric shock. The flies demonstrated that during starvation they were unable to form aversive long-term memories, but their brains did retain the ability to create appetitive long-term memories.
The paper also points out that the same features in flies that create memories are also at work in mammals. Further, when the starved neurons responsible for developing aversive long-term memories, their lives were shorted suggesting a long term effect on memory tied to starvation.