Eating olives can affect one's memory (Horayos 13b). The Ari z"l writes that this is only true for an ignorant person or someone who eats them without the appropriate intention. However, someone who eats them with the proper intention will increase his memory since eating them for the sake of serving Hashem causes an ascension for the olives and brings about a rectification for them.
--Magen Avrohom SA, 170:19