Not only does eating junk food leads to unwanted obesity, it also affects one's memory, according to researchers from the University of NSW.

Conducting a research on groups of rats on different diets, scientists discovered a diet of junk food high in saturated fat and sugar can impair one's memory after just six days.

Students harvest vegetables from a field outside the Democracy Elementary and Middle School in Sitong town, Henan province December 3, 2013. In a remote part of central China, the day starts at the Democracy Elementary and Middle School with a pre-dawn jog, some revolutionary songs and then an activity long since forgotten at other schools: reciting quotations from Mao Zedong's famed 'Little Red Book'. While the ruling Communist Party that Mao led continues to hold him in esteem as the leader of the Communist Revolution, his radical policies and teachings have been largely shelved since his death in 1976 in favour of a pro-market approach that has turned China from a backwater into the world's second biggest economy. The 120th anniversary of Mao's birth is on December 26, 2013. Picture taken December 3, 2013. REUTERS/Carlos Barria

"Interestingly, our rats were not obese and these changes emerged at day five," Margaret Morris, the head of pharmacology at the University of NSW, told AAP.

"So you don't have to be obese, you just have to eat poorly."

''We know obesity causes inflammation in the body, but we didn't realise until recently that it causes changes in the brain,'' Ms Morris noted.

The animals given a poor diet of junk food showed a poor ability to notice objects when they have moved or transferred to a new location. Spatial memory is highly essential in everyday lives, for it is the ability to recall where everyday items are located such as wallets or mobile phones.

But what alarmed the researchers was the speed at which one can lose memory after eating a diet of unhealthy food.

''After consuming a high sugar and fat diet for one week, we found that the hippocampus, the brain structure which is critical for learning and memory, had increased inflammation,'' Ms Morris said. "We were surprised at how fast it was."

What's more, whatever damage incurred is permanent.

''Our preliminary data also indicates that the damage is not reversed when the rats are switched back to a healthy diet.''

The research was published in the Brain, Behaviour and Immunity journal.