German researchers put 141 healthy adults through a series of memory and blood sugar tests. The study team also performed brain scans to measure each of the participants’ hippocampi, an area that plays a big role in memory. Here’s what they found: the higher a person’s blood sugar, the worse they performed on tasks measuring recall and learning ability. Higher levels of long-term blood glucose markers were also linked with a smaller hippocampus. Even people with normal blood sugar levels weren’t in the clear, since memory suffered when short-term glucose markers spiked. “Elevated blood sugar levels damage small and large vessels in the brain, leading to decreased blood and nutrient flow to brain cells,” explains study co-author Agnes Flöell, MD, a neurologist at Berlin’s Charité Medical University. High blood sugar may also disturb signaling between and within the cells of your hippocampus, Dr. Flöell says. The most drastic memory issues are related to long-term markers of elevated blood sugar, her research shows. You don’t have to give up sugar to keep your mind sharp. But there are steps you should take to protect your memory from high blood glucose. Dr. Flöell recommends eating a diet rich in fiber, protein, and whole grains to help your body move along and expel the sugary foods you eat. She says regular exercise also helps keep your blood sugar low because your body burns sugar for energy while you work out. For those 55 and older, Flöell advises asking your doctor to perform a test for fasting glucose and levels of the blood sugar marker HbA1c. Both of these can help your physician detect high blood sugar early so you can take steps to address the problem before it begins to impair your brain function, she says. More from Prevention: How Sleep Can Improve Your Blood Sugar