With the death of the brain, all our memories perish.
Brain is the instrumental part of expressing the higher states of consciousness in matter.
Even when you have a functional brain the causal link between brain (matter) and consciousness is well-established and in fact what the consciousness perceives, feels, senses, thinks and so on is manifested as electrical impulses in matter (brain) and these get converted into synaptic connections and hormonal discharges etc.
On death, the imprints of your life activities and thoughts are stored in the psychic consciousness and so nothing is lost.
The Hebrew account of life, death and the afterlife is highly misleading but this only to be expected from the ignorant patriarchs.