Ego-memory is the term used to describe the consciousness of an individual present in genetic memory.
With the exception of the Atreides: Paul, Alia, Leto II and Ghanima, the only people who could be exposed to ego-memories were Bene Gesserit Reverend Mothers, and non-Bene Gesserit women who took the Water of Life and survived.
It was theorised that only those with Bene Gesserit training and mental discipline were capable of preventing an ego-memory from taking over their consciousness, thereby effectively possessing them and becoming abomination.
Since Alia Atreides had been pre-born to consciousness, she did not have the ability to prevent her consciousness from being overcome by the memories of her ancestors. As she grew into an adult, it became increasingly difficult for her to control the "inner multitude", and the voices of those within her would increasingly impede on her consciousness. In order to minimise this, she made an agreement with the ego-memory of the Baron Vladimir Harkonnen, her maternal grandfather, to quell the others, in exchange for sharing her consciousness. True to his devious form, however, the ego-likeness of the Harkonnen took more control of Alia than bargained for, and Alia was possessed by him.
Ultimately, Alia managed to overcome her possession by throwing herself from a high window, killing herself, and the ego-memories of all within her, including the Baron.
Leto II and the Idaho Gholas Edit
When Leto II became Emperor, he had a series of Duncan Idaho gholas created to serve him across the millennia. Upon their first arrival at his Keep, Leto would use the voices and ego-memories of the long dead Duke Leto and Paul to ease Idaho's adjustment to the new order.